1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
#! perl -T
use strict;
use warnings;
use Test::More;
use Test::Fatal 'lives_ok';
use File::Map qw/:map lock_map advise/;
use Scalar::Util qw/tainted/;
plan skip_all => 'No taint support' if not tainted($0);
my $map;
lives_ok { map_file($map, $0) } 'Can map under tainting';
ok(tainted($map), 'mapped file is tainted');
ok(substr($map, 1, 10), 'substring from mapping is also tainted');
my $piece = substr($map, 1, 10);
ok(tainted($piece), 'copy of substring from mapping is also tainted');
done_testing;
|