$filepath = '/u/test/global/filename.txt'; my ( @data ) = split /\//, $filepath; my ( $filename ) = $data[$#data]; print "$filename" ; ## will print filename.txt
In reply to Re: How do I extract a file name from a path string
by Anonymous Monk
in thread How do I extract a file name from a path string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |