Help for this page

Select Code to Download


  1. or download this
    my $path = "/path/ending/with/a/filename";
    
    my $file = (split(/\//,$path))[-1];
    
    print "$file\n";
    
  2. or download this
    use File::Spec;
    
    ...
    my ($volume, $path, $file) = File::Spec->splitpath($fullpath);
    
    print "$file\n";