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:
This code doesn't workmy @tmp = split(/\//, '/home/bin/scripts/test.pl'); my $fname = pop @tmp;
because split in the scalar context returns a size of array. Of course, I can use regular expressions, I know it.my $fname = pop split(/\//, '/home/bin/scripts/test.pl');
*-*-*-*-*-* { firstname => 'Michael', quote => 'Mice were crying and stinging but went on nibbling the + cactus', }
Back to
Seekers of Perl Wisdom