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");
In reply to Re^2: Dissecting a complete pathname to a file
by ikegami
in thread Dissecting a complete pathname to a file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |