in reply to Retrieve only what I need from split without using temp array
print ((split ',' , $foo)[2])); print "\n";
That just looks nasty. I use this quite a bit when using stat and am only interested in say the file size, but then I am assigning it to a single scalar $size as merlyn shows, which eliminates the need for the second set of parens.
Cheers - Limbic~Region
Update Added parens to get it to work.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Retrieve only what I need from split without using temp array
by leriksen (Curate) on Aug 06, 2003 at 03:05 UTC | |
by RMGir (Prior) on Aug 06, 2003 at 11:55 UTC | |
by bbfu (Curate) on Aug 06, 2003 at 19:09 UTC |