in reply to Re: Dissecting a complete pathname to a file
in thread Dissecting a complete pathname to a file

That returns the file. What about the second requirement to capture the directory?

use Cwd qw( abs_path ); my $full = abs_path($file_path); my ($dir, $file) = $full =~ /^(.*)\\(.*)/; # Wrong for C:\File my ($dir, $file) = $full =~ /^(.*\\)(.*)/; # Ugly for C:\Dir\File

A regular expression is not the way to go here. As seen below, there are better (reliable, tested, portable) options in Core Perl.