in reply to How to access directly an element of an array / list returned by a function?
So,( EXPR )[$index] ( EXPR )[@indexes]
There's alsouse File::Spec qw( ); my $file = ( File::Spec->splitpath($path) )[2];
use File::Basename qw( basename ); # Also core module my $file = basename($path);
use File::Path qw( file ); # Addresses issues with File::Spec my $file = file($path)->basename();
|
|---|