in reply to extracting data

If this is the sole task of your perl script, then note that you can run any of the above solutions right from the command line (see perlrun for more details):
perl -pe 's#.+/##' file.txt perl -MFile::Basename -pe '$_=basename $_' file.txt perl -MFile::Basename -ne 'print basename $_' file.txt perl -ne 'print ( (split("/", $_))[-1] )' file.txt perl -F/ -ane 'print $F[-1]' file.txt cut -d/ -f6 file.txt