blax has asked for the wisdom of the Perl Monks concerning the following question:
My first question is can you have split return just the second match instead of one and two. To get that result Ive been doing it like this:
My second and last question is why the following did not work:
I did get it to work by doing this:
Thanks in advance,
blax
($foo, $match_I_want) = split /:/, $_, [2];
My second and last question is why the following did not work:
($user, $foo{$user}) = split /:/, $_, [2];
I did get it to work by doing this:
($user) = split /:/, $_, [1]; ($temp, $foo{$user}) = split /:/, $_, [2];
Thanks in advance,
blax
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Questions about split (indexing /etc/passwd)
by petdance (Parson) on Jul 01, 2001 at 11:22 UTC | |
by blax (Sexton) on Jul 01, 2001 at 12:18 UTC | |
Re: Questions about split
by damian1301 (Curate) on Jul 01, 2001 at 11:04 UTC | |
Re: Questions about split
by lestrrat (Deacon) on Jul 01, 2001 at 12:12 UTC | |
Re: Questions about split
by chromatic (Archbishop) on Jul 01, 2001 at 23:34 UTC | |
Re: Questions about split
by MZSanford (Curate) on Jul 01, 2001 at 12:20 UTC | |
Re: Questions about split
by RhetTbull (Curate) on Jul 01, 2001 at 23:26 UTC | |
Re: Questions about split
by John M. Dlugosz (Monsignor) on Jul 02, 2001 at 03:53 UTC |
Back to
Seekers of Perl Wisdom