#!usr/bin/env perl use strict; use warnings; use File::Temp qw(tempdir); use File::Spec::Functions qw(catfile); my $dir = tempdir('pmtest_XXXXX', TMPDIR => 1, CLEANUP => 1); my $test_filename = '{a}'; my $full_path = catfile($dir, $test_filename); open my $fh, '>', $full_path or die "Cannot create $full_path: $!\n"; print $fh "Hello world.\n"; close $fh; print "We created $full_path as a file.\n" if -e $full_path && -f _; my $target = "$full_path.extra"; $target =~ s/$full_path//;