Syntactic Confectionery Delight | |
PerlMonks |
Re: Questions about splitby RhetTbull (Curate) |
on Jul 01, 2001 at 23:26 UTC ( [id://93052]=note: print w/replies, xml ) | Need Help?? |
To answer your first question, you could just do this:
$field_i_want = (split /:/)[2];
That just creates a single element slice of the list returned by split. If you only wanted elements 2 and 5 you could do this:
($want1,$want2) = (split /:/)[2,5];
In Section
Seekers of Perl Wisdom
|
|