Help for this page

Select Code to Download


  1. or download this
    use File::Spec::Functions qw( splitpath catpath rel2abs canonpath );
    
    my ($v, $p, $file_name) = splitpath(rel2abs($file_path));
    my $dir_path = canonpath(catpath($v, $p));
    
  2. or download this
    use File::Basename        qw( fileparse );
    use File::Spec::Functions qw( rel2abs );
    
    my ($file_name, $dir_path) = fileparse(rel2abs($file_path));