|Welcome to the Monastery|
Returning first element of an array from a functionby lcanty (Friar)
|on Mar 17, 2004 at 07:43 UTC ( #337245=perlquestion: print w/replies, xml )||Need Help??|
lcanty has asked for the wisdom of the Perl Monks concerning the following question:
Afternoon fellow monks,
I've only just started learning Perl and have been a little stumped with the following,i know perl has lots of nifty shortcuts but is this possible...
given a function, (the one i've been using is split) that returns an array is it possible to only return the first element of the array from the function and assign that to a scalar...
$bar = "some.text";
now i know i could make $foo an array like @foo and access the first element of that.
Back to Seekers of Perl Wisdom