in reply to returning scalar context from map or grep

Do you mean something like:
my @ary=qw/dog cat gnat/; my $first=(grep {/at$/} @ary)[0]; print $first; __END__ cat

CU
Robartes-

Replies are listed 'Best First'.
Re: Re: returning scalar context from map or grep
by !unlike (Beadle) on Apr 28, 2003 at 13:14 UTC

    AAAARRRRGGGG!!!!!

    I tried every method I knew apart from that one!

    Thanks Robartes, it worked a treat! ;)

    !unlike

    I write my Perl code like how I like my sex: fast and dirty. ;)