http://qs1969.pair.com?node_id=241089

nite_man has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks, Maybe somebody knows how do write a following code without a temporary variable @tmp:
my @tmp = split(/\//, '/home/bin/scripts/test.pl'); my $fname = pop @tmp;
This code doesn't work
my $fname = pop split(/\//, '/home/bin/scripts/test.pl');
because split in the scalar context returns a size of array. Of course, I can use regular expressions, I know it.
*-*-*-*-*-* { firstname => 'Michael', quote => 'Mice were crying and stinging but went on nibbling the + cactus', }