in reply to Data Extraction Question

If you may need the filename later on:
my ($directory) = $fullpath =~ m|^(.*/)?|;
This will slurp as much as it can, as long as it's followed by a slash. $directory will be undefined if there isn't one in there... Or
my ($directory) = $fullpath =~ m|^(?:(.*)/)?|;
if you don't like the trailing slash on the path...