in reply to Re: Dissecting a complete pathname to a file
in thread Dissecting a complete pathname to a file
Why handle only one very specific relative path? Fix:
use strict; use warnings; use File::Basename qw( fileparse ); use File::Spec::Functions qw( rel2abs ); my $file_path = './hello.world'; my ($file_name, $dir_path) = fileparse(rel2abs($file_path)); print("dir path: $dir_path\n"); print("file name: $file_name\n");
|
|---|