in reply to Getting the filename from full path name ?
ormy @path_pieces = split('/', $path); my $last_path_piece = $path_pieces[$#path_pieces];
my ($last_path_piece) = $path =~ m|/(.*?)$|;
to give a couple of the more idiomatic methods.my ($last_path_piece) = $path =~ m|([^/]*)$|;
------------ :Wq Not an editor command: Wq
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Getting the filename from full path name ?
by satchm0h (Beadle) on Apr 15, 2004 at 17:09 UTC | |
by etcshadow (Priest) on Apr 15, 2004 at 17:53 UTC |