Help for this page

Select Code to Download


  1. or download this
    use File::Basename;
    $pathandfile='C:\temp\foo foo\foo foo.txt';
    ($filename, $path)=fileparse($pathandfile);
    
    print "$path = $filename";
    
  2. or download this
    fileparse - split a pathname into pieces
    
    filename - extract just the filename from a path
    
    path - extract just the directory from a path