my $filepath= $param =~ m#^((?:/?[.\w][-.\w]*)+)\z# or die "Invalid file path ($param).\n";