I have a Perl variable I populate from the database. Its name is $path. I need to get another variable $file which has just the filename from the pathname.
$path
$file
I tried:
$file = $path =~ s/.*\///;
I am very new to Perl.
use File::Basename
Check the below link for a detailed description on how it works:
http://p3rl.org/File::Basename