On Tue, May 09, 2006 at 11:52:26AM -0700, Timothy Johnson wrote:
>
> As much as I would hate to make you cry, if I had my way, I'd remove
> that as well as the default variable $_. It would be like the first
> time you had to convert all of your scripts to use the strict pragma,
> but in the end
On Tue, 2006-09-05 at 14:54 -0700, Bryan R Harris wrote:
> Regarding Timothy's thoughts, I tend to believe perl wouldn't be as popular
> if the "use strict" pragma defaulted to on. I don't code in C because it's
> too hard to get all the little details right. Perl is very forgiving, and
> for my
> On Tue, 2006-09-05 at 11:52 -0700, Timothy Johnson wrote:
>> It's the Perl
>> equivalent of having to remember 'I before E except after C...'.
>
> '.. except where it's not.'
>
> E.g:
> height
> weight
> sex
>
> (OK, I included 'sex' just to get your attention.)
On some platforms:
"Mr. Shawn H. Corey" schreef:
> Dr.Ruud:
>> One exception: the pattern / / does not work like the pattern ' '.
>
> But it should, that's my point.
Not for / / vs. ' ', because that is a special case. It is far too late
to change the special case to undef or whatever.
I like your example that sh
All,
I am trying to populate a scalar (ideally a hash) using a Perl grep but
it is not working. I even tried to use an array and no data was pushed.
use strict;
use warnings;
my @lvs;
my @lvaray = qx(bdf);
foreach (@lvaray) {
if (/(?)vg00/) {
push @lvs, (split)[0]
}
}
Per Larsson am Dienstag, 9. Mai 2006 17.50:
> Thank you, that solved the problem, but only partly I'm afraid. Problem
> is that the lines need to be formatted in a certain way, so that one
> line looks exactly like this:
> ATOM 1 N ALA 1 41.744 64.901 30.842 1.00 47.38
> 2CDV 8
On Tue, 2006-09-05 at 11:52 -0700, Timothy Johnson wrote:
> It's the Perl
> equivalent of having to remember 'I before E except after C...'.
'.. except where it's not.'
E.g:
height
weight
sex
(OK, I included 'sex' just to get your attention.)
--
__END__
Just my 0.0002 million dolla
-Original Message-
From: Bryan R Harris [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 09, 2006 11:24 AM
To: Beginners Perl
Subject: Re: array question
>> On Tue, 2006-09-05 at 18:33 +0200, Dr.Ruud wrote:
>>> One exception: the pattern / / does not work like the pattern ' '.
>>
>> But it
On Tue, 2006-09-05 at 11:23 -0700, Bryan R Harris wrote:
> Are you proposing that the special case be removed? If so, PLEASE NO! I
> use that special case in almost every script I write, and if they removed it
> I would probably shed tears over it.
Don't worry; they won't. Well, maybe in Perl6;
> On Tue, 2006-09-05 at 18:33 +0200, Dr.Ruud wrote:
>> One exception: the pattern / / does not work like the pattern ' '.
>
> But it should, that's my point.
Are you proposing that the special case be removed? If so, PLEASE NO! I
use that special case in almost every script I write, and if t
Mr. Shawn H. Corey wrote:
> On Tue, 2006-09-05 at 09:05 -0700, John W. Krahn wrote:
>>I don't understand what you are trying to say.
>
> I saying this should work:
>
> split '+', 'this+is+a+test';
>
> Yes, I know how to fix it. I'm saying it _should_ work, not that it
> does. If split is follo
On Tue, 2006-09-05 at 09:44 -0700, chen li wrote:
> split /PATTERN/,EXPR,LIMIT
> split /PATTERN/,EXPR
> split /PATTERN/
> split
>
> 1. I check the perldoc -f split but I am not quite
> sure what EXPR really means. Does it refer to a
> string, or a scalar variable contaning a string, or an
> ar
On Tue, 2006-09-05 at 18:33 +0200, Dr.Ruud wrote:
> One exception: the pattern / / does not work like the pattern ' '.
But it should, that's my point.
--
__END__
Just my 0.0002 million dollars worth,
--- Shawn
"For the things we have to learn before we can do them, we learn by doing t
On Tue, 2006-09-05 at 09:05 -0700, John W. Krahn wrote:
> I don't understand what you are trying to say.
I saying this should work:
split '+', 'this+is+a+test';
Yes, I know how to fix it. I'm saying it _should_ work, not that it
does. If split is followed by a string, the string should be quot
chen li wrote:
>
> --- "John W. Krahn" <[EMAIL PROTECTED]> wrote:
>>
>>$ perl -le'
>>my $string = q[ a b c d ];
>>print join "\t", map "<$_>", split q[\s+],
>>qq[$string], q[4];
>>print join "\t", map "<$_>", split /\s+/,
>>$string,4;
>>'
>><>
>><>
>>
>
Mr. Shawn H. Corey" schreef:
> John W. Krahn:
>> Anything used as a pattern is a string. See the "Quote and
>> Quote-like Operators" section of perlop:
>
> Huh?
>
> Do you mean all strings can be used as a pattern?
>
> split( quotemeta( $split_string ), $data_string );
>
>
> Or that patterns ar
--- "John W. Krahn" <[EMAIL PROTECTED]> wrote:
> Mr. Shawn H. Corey wrote:
> > On Tue, 2006-09-05 at 01:33 +0200, Paul Johnson
> wrote:
> >>Um, that's not quite correct.
> >>
> >>See `perldoc -f split` for details.
> >
> > Oh, yes, a special case. I have long ago abandoned
> special cases since
Mr. Shawn H. Corey wrote:
> On Tue, 2006-09-05 at 01:30 -0700, John W. Krahn wrote:
>>Anything used as a pattern is a string. See the "Quote and Quote-like
>>Operators" section of perlop:
>
> Huh?
>
> Do you mean all strings can be used as a pattern?
A pattern is a string. Perl does string int
M. Kristall wrote:
> chen li wrote:
I have an arry like this:
@arry=('AA bb','BB','CC AG')
How do I turn it into new array like this:
> TMTOWTDI
@new_array=('AA','bb','BB','CC','AG')
>>> my @new_array = split ' ', "@arry";
>>
>> Both line codes work perfectly:
>>
Thank you, that solved the problem, but only partly I'm afraid. Problem
is that the lines need to be formatted in a certain way, so that one
line looks exactly like this:
ATOM 1 N ALA 1 41.744 64.901 30.842 1.00 47.38
2CDV 83
Is there a way to combine the code below w
On 5/9/06, Per Larsson <[EMAIL PROTECTED]> wrote:
snip
ie. get everything that is sitting between two ATOM-identifiers to occur
on the same line. How can I achieve this?
As always, TMTOWTDI:
You can set the input record separator
use strict;
use warnings;
{
local $/ = 'ATOM\n';
<>; #throw awa
Hello,
I have a question about doing the following in perl:
I have a file (a protein pdb file) thatt, for various (and unchangeable)
reasons look like this:
ATOM
1
N
ALA
1
41.744
64.901
30.842
1.00
47.38
2CDV
83
ATOM
2
CA
ALA
1
41.676
63.465
31.165
1.00
47.22
2CDV
84
...and so on. What I woul
chen li wrote:
I have an arry like this:
@arry=('AA bb','BB','CC AG')
How do I turn it into new array like this:
TMTOWTDI
@new_array=('AA','bb','BB','CC','AG')
my @new_array = split ' ', "@arry";
Both line codes work perfectly:
my @new_array = map { split } @arry;
or
my @new_array = spl
On Tue, 2006-09-05 at 01:30 -0700, John W. Krahn wrote:
> Anything used as a pattern is a string. See the "Quote and Quote-like
> Operators" section of perlop:
Huh?
Do you mean all strings can be used as a pattern?
split( quotemeta( $split_string ), $data_string );
Or that patterns are buil
On Tue, 9 May 2006, zentara wrote:
On Tue, 9 May 2006 09:57:29 +0100 (WEST), [EMAIL PROTECTED]
(Jorge Almeida) wrote:
Is there any Perl module to find and kill unix processes (pgrep, kill,
pkill...). I need to kill all processes descending from a given process
(children, grandchildren, etc). S
Is there any Perl module to find and kill unix processes (pgrep, kill,
pkill...). I need to kill all processes descending from a given process
(children, grandchildren, etc). Surprisingly, it seems there isn't a
unix utility for this, so I thought to make a Perl script, but using
system seems clum
"Dan" schreef:
Please don't top-post.
> "name" <[EMAIL PROTECTED]>
> the question was pertaining to get 'name' out of "name" at the start,
> and the email address out of the <<>> brackets. however i managed to
> figure that one out by playing.
Don't play but use Regexp::Common::Email::Address
h
Mr. Shawn H. Corey wrote:
> On Tue, 2006-09-05 at 01:33 +0200, Paul Johnson wrote:
>>Um, that's not quite correct.
>>
>>See `perldoc -f split` for details.
>
> Oh, yes, a special case. I have long ago abandoned special cases since
> they lead to errors. Note that `perldoc -f split` starts with:
>
Hi,
require $file is like do $file, except the former:
checks for redundant loading, skipping already loaded
files.
raises an exception on failure to find, compile, or
execute $file.
use Module is like require Module, except the former:
loads the module at compile time, n
On Tue, May 09, 2006 at 03:16:45PM +0800, Practical Perl wrote:
> Could anyone tell me what's the difference between 'use' and 'require'?
> And,is there any difference for these two statements?
>
> use Exporter ();
> require Exporter;
I think that "perldoc -f use" should tell you everything you
hi
thanks for the pointers. i think the news thing, or something, made the
question a little unclear, as it stripped some characters from the input.
the input is the default way email headers are sent with the "from" and "to"
portions,
"name" <[EMAIL PROTECTED]>
the question was pertaining to ge
On 5/7/06, Dan <[EMAIL PROTECTED]> wrote:
i been doing perl long enough that you'd think i should know this, but one
thing i've never ever ever managed to get my head around is how regex works.
i'm using net::pop3 (mail::pop3client doesn't work!), and i'm trying to
extract certain data from the
Could anyone tell me what's the difference between 'use' and 'require'?
And,is there any difference for these two statements?
use Exporter ();
require Exporter;
Thank you.
33 matches
Mail list logo