my $full_file = '/usr/local/prj/code/prog/prog1'; print "Filename is: " . (split '/', $full_file)[-1];