in reply to dir / file split

This has a belt-and-suspenders quality, due to $2 explicitly excluding the directory delimiter:

$file_path =~ /(.*)\/([^/]*)/; my ($dir, $file) = ($1, $2);

It should satisfy all reasonable paranoia.