problem one, covered in
PAR::FAQ
unless(caller)
Problem two
$source_path = win_path($source_path);
$destination_path = win_path($destination_path);
if (!$destination_path)
{
$destination_path = $source_path;
}
my @files = <$source_path\\*>;
my %seen;
my $search = 'while (<>) { study;';
$search .= "++\$seen{\$ARGV} if /\\b_$project_id\\b/;\n";
$search .= "}";
@ARGV = @files;
undef $/;
eval $search;
$/ = "\n";
Don't use string eval, especially for something like that.
That should be a single function call, see
qr,
quotemeta,
local