Linux cpanel2.daytoncreative.net 2.6.32-754.29.2.el6.x86_64 #1 SMP Tue May 12 17:39:04 UTC 2020 x86_64
Apache/2.4.43 (cPanel) OpenSSL/1.1.1g mod_bwlimited/1.4
Server IP : 70.62.220.67 & Your IP : 216.73.216.193
Domains :
Cant Read [ /etc/named.conf ]
User : michaelgreg
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
log /
perl-5.20.2 /
t /
op /
Delete
Unzip
Name
Size
Permission
Date
Action
64bitint.t
8.14
KB
-r--r--r--
2014-12-27 11:49
alarm.t
1.5
KB
-r--r--r--
2014-12-27 11:49
anonsub.t
1.7
KB
-r--r--r--
2014-12-27 11:49
append.t
1.58
KB
-r--r--r--
2014-12-27 11:49
args.t
2.12
KB
-r--r--r--
2014-12-27 11:49
array.t
12.32
KB
-r--r--r--
2014-12-27 11:49
array_base.t
720
B
-r--r--r--
2014-12-27 11:49
assignwarn.t
1.52
KB
-r--r--r--
2014-12-27 11:49
attrhand.t
1.01
KB
-r--r--r--
2014-12-27 11:49
attrproto.t
6.55
KB
-r--r--r--
2014-12-27 11:49
attrs.t
10.73
KB
-r--r--r--
2014-12-27 11:49
auto.t
2.36
KB
-r--r--r--
2014-12-27 11:49
avhv.t
4.04
KB
-r--r--r--
2014-12-27 11:49
bless.t
4.12
KB
-r--r--r--
2014-12-27 11:49
blocks.t
2.95
KB
-r--r--r--
2014-12-27 11:49
bop.t
12.82
KB
-r--r--r--
2014-12-27 11:49
caller.pl
3.75
KB
-r--r--r--
2014-12-27 11:49
caller.t
8.14
KB
-r--r--r--
2014-12-27 11:49
chars.t
1.73
KB
-r--r--r--
2014-12-27 11:49
chdir.t
6.68
KB
-r--r--r--
2014-12-27 11:49
chop.t
7.67
KB
-r--r--r--
2014-12-27 11:49
chr.t
2.48
KB
-r--r--r--
2014-12-27 11:49
closure.t
19.6
KB
-r--r--r--
2014-12-27 11:49
closure_test.pl
327
B
-r--r--r--
2014-12-27 11:49
concat2.t
1.41
KB
-r--r--r--
2014-12-27 11:49
cond.t
282
B
-r--r--r--
2014-12-27 11:49
context.t
404
B
-r--r--r--
2014-12-27 11:49
coreamp.t
29.17
KB
-r--r--r--
2014-12-27 11:49
coresubs.t
4.87
KB
-r--r--r--
2014-12-27 11:49
cproto.t
3.6
KB
-r--r--r--
2014-12-27 11:49
crypt.t
1.17
KB
-r--r--r--
2014-12-27 11:49
current_sub.t
1.71
KB
-r--r--r--
2014-12-27 11:49
dbm.t
1.54
KB
-r--r--r--
2014-12-27 11:49
defined.t
551
B
-r--r--r--
2014-12-27 11:49
defins.t
4.84
KB
-r--r--r--
2014-12-27 11:49
delete.t
2.93
KB
-r--r--r--
2014-12-27 11:49
die.t
1.99
KB
-r--r--r--
2014-12-27 11:49
die_except.t
1.57
KB
-r--r--r--
2014-12-27 11:49
die_exit.t
1.9
KB
-r--r--r--
2014-12-27 11:49
die_keeperr.t
1.57
KB
-r--r--r--
2014-12-27 11:49
die_unwind.t
1.69
KB
-r--r--r--
2014-12-27 11:49
do.t
8.35
KB
-r--r--r--
2014-12-27 11:49
dor.t
2.64
KB
-r--r--r--
2014-12-27 11:49
each.t
7.09
KB
-r--r--r--
2014-12-27 11:49
each_array.t
5.48
KB
-r--r--r--
2014-12-27 11:49
eval.t
13.92
KB
-r--r--r--
2014-12-27 11:49
evalbytes.t
989
B
-r--r--r--
2014-12-27 11:49
exec.t
4.36
KB
-r--r--r--
2014-12-27 11:49
exists_sub.t
2.09
KB
-r--r--r--
2014-12-27 11:49
exp.t
1.47
KB
-r--r--r--
2014-12-27 11:49
fh.t
790
B
-r--r--r--
2014-12-27 11:49
filehandle.t
564
B
-r--r--r--
2014-12-27 11:49
filetest.t
11.97
KB
-r--r--r--
2014-12-27 11:49
filetest_stack_ok.t
1.12
KB
-r--r--r--
2014-12-27 11:49
filetest_t.t
1.18
KB
-r--r--r--
2014-12-27 11:49
flip.t
868
B
-r--r--r--
2014-12-27 11:49
for.t
12.77
KB
-r--r--r--
2014-12-27 11:49
fork.t
8.8
KB
-r--r--r--
2014-12-27 11:49
fresh_perl_utf8.t
411
B
-r--r--r--
2014-12-27 11:49
getpid.t
1.61
KB
-r--r--r--
2014-12-27 11:49
getppid.t
3.13
KB
-r--r--r--
2014-12-27 11:49
glob.t
4.22
KB
-r--r--r--
2014-12-27 11:49
gmagic.t
5.97
KB
-r--r--r--
2014-12-27 11:49
goto.t
14.85
KB
-r--r--r--
2014-12-27 11:49
goto_xs.t
2.98
KB
-r--r--r--
2014-12-27 11:49
grent.t
4.46
KB
-r--r--r--
2014-12-27 11:49
grep.t
6.66
KB
-r--r--r--
2014-12-27 11:49
groups.t
11.15
KB
-r--r--r--
2014-12-27 11:49
gv.t
30.15
KB
-r--r--r--
2014-12-27 11:49
hash-rt85026.t
1.57
KB
-r--r--r--
2014-12-27 11:49
hash.t
6.02
KB
-r--r--r--
2014-12-27 11:49
hashassign.t
18.85
KB
-r--r--r--
2014-12-27 11:49
hashwarn.t
2.05
KB
-r--r--r--
2014-12-27 11:49
heredoc.t
2.29
KB
-r--r--r--
2014-12-27 11:49
inc.t
6.72
KB
-r--r--r--
2014-12-27 11:49
inccode-tie.t
338
B
-r--r--r--
2014-12-27 11:49
inccode.t
11.19
KB
-r--r--r--
2014-12-27 11:49
incfilter.t
7.33
KB
-r--r--r--
2014-12-27 11:49
index.t
6.81
KB
-r--r--r--
2014-12-27 11:49
index_thr.t
56
B
-r--r--r--
2014-12-27 11:49
int.t
1.72
KB
-r--r--r--
2014-12-27 11:49
join.t
3.2
KB
-r--r--r--
2014-12-27 11:49
kill0.t
3.18
KB
-r--r--r--
2014-12-27 11:49
kill0_child
596
B
-r--r--r--
2014-12-27 11:49
kvaslice.t
4.66
KB
-r--r--r--
2014-12-27 11:49
kvhslice.t
5.44
KB
-r--r--r--
2014-12-27 11:49
lc.t
11.8
KB
-r--r--r--
2014-12-27 11:49
leaky-magic.t
3.43
KB
-r--r--r--
2014-12-27 11:49
length.t
5.03
KB
-r--r--r--
2014-12-27 11:49
lex.t
2.33
KB
-r--r--r--
2014-12-27 11:49
lex_assign.t
7.17
KB
-r--r--r--
2014-12-27 11:49
lexsub.t
19.62
KB
-r--r--r--
2014-12-27 12:24
lfs.t
6.2
KB
-r--r--r--
2014-12-27 11:49
list.t
5.31
KB
-r--r--r--
2014-12-27 11:52
local.t
17.11
KB
-r--r--r--
2014-12-27 11:49
localref.t
2.73
KB
-r--r--r--
2014-12-27 11:49
lock.t
465
B
-r--r--r--
2014-12-27 11:49
loopctl.t
17.88
KB
-r--r--r--
2014-12-27 11:49
lop.t
1.2
KB
-r--r--r--
2014-12-27 11:49
magic-27839.t
622
B
-r--r--r--
2014-12-27 11:49
magic.t
21.81
KB
-r--r--r--
2014-12-27 11:49
method.t
18.91
KB
-r--r--r--
2014-12-27 11:49
mkdir.t
1.25
KB
-r--r--r--
2014-12-27 11:49
my.t
4.29
KB
-r--r--r--
2014-12-27 11:49
my_stash.t
769
B
-r--r--r--
2014-12-27 11:49
mydef.t
5.51
KB
-r--r--r--
2014-12-27 11:49
negate.t
4.3
KB
-r--r--r--
2014-12-27 11:49
not.t
3.15
KB
-r--r--r--
2014-12-27 11:49
numconvert.t
8.33
KB
-r--r--r--
2014-12-27 11:49
oct.t
3.58
KB
-r--r--r--
2014-12-27 11:49
or.t
1.79
KB
-r--r--r--
2014-12-27 11:49
ord.t
2.48
KB
-r--r--r--
2014-12-27 11:49
overload_integer.t
506
B
-r--r--r--
2014-12-27 11:49
override.t
4.33
KB
-r--r--r--
2014-12-27 11:49
pack.t
65.34
KB
-r--r--r--
2014-12-27 11:49
packagev.t
5.97
KB
-r--r--r--
2014-12-27 11:49
pos.t
3.59
KB
-r--r--r--
2014-12-27 11:49
postfixderef.t
11.97
KB
-r--r--r--
2014-12-27 11:49
pow.t
2.34
KB
-r--r--r--
2014-12-27 11:49
print.t
692
B
-r--r--r--
2014-12-27 11:49
protowarn.t
1.35
KB
-r--r--r--
2014-12-27 11:49
push.t
3.03
KB
-r--r--r--
2014-12-27 11:49
pwent.t
6.63
KB
-r--r--r--
2014-12-27 11:49
qr.t
2.32
KB
-r--r--r--
2014-12-27 11:49
quotemeta.t
5.61
KB
-r--r--r--
2014-12-27 11:49
rand.t
8.31
KB
-r--r--r--
2014-12-27 11:49
range.t
9.25
KB
-r--r--r--
2014-12-27 11:49
read.t
2.28
KB
-r--r--r--
2014-12-27 11:49
readdir.t
2.09
KB
-r--r--r--
2014-12-27 11:49
readline.t
7.19
KB
-r--r--r--
2014-12-27 11:49
recurse.t
2.73
KB
-r--r--r--
2014-12-27 11:49
ref.t
22.74
KB
-r--r--r--
2014-12-27 11:49
repeat.t
4.8
KB
-r--r--r--
2014-12-27 11:49
require_37033.t
1.18
KB
-r--r--r--
2014-12-27 11:49
require_errors.t
3.68
KB
-r--r--r--
2014-12-27 11:49
reset.t
5.41
KB
-r--r--r--
2014-12-27 11:49
reverse.t
3.01
KB
-r--r--r--
2014-12-27 11:49
rt119311.t
5.58
KB
-r--r--r--
2014-12-27 11:49
runlevel.t
5.28
KB
-r--r--r--
2014-12-27 11:49
select.t
1.03
KB
-r--r--r--
2014-12-27 11:49
setpgrpstack.t
378
B
-r--r--r--
2014-12-27 11:49
sigdispatch.t
4.33
KB
-r--r--r--
2014-12-27 11:49
signatures.t
41.02
KB
-r--r--r--
2014-12-27 11:49
sigsystem.t
1.36
KB
-r--r--r--
2014-12-27 11:49
sleep.t
468
B
-r--r--r--
2014-12-27 11:49
smartkve.t
18.26
KB
-r--r--r--
2014-12-27 11:49
smartmatch.t
10.34
KB
-r--r--r--
2014-12-27 11:49
sort.t
28.4
KB
-r--r--r--
2015-01-10 13:17
splice.t
3.38
KB
-r--r--r--
2014-12-27 11:49
split.t
13.1
KB
-r--r--r--
2014-12-27 11:49
split_unicode.t
2.4
KB
-r--r--r--
2014-12-27 11:49
sprintf.t
28.5
KB
-r--r--r--
2014-12-27 11:49
sprintf2.t
5.49
KB
-r--r--r--
2014-12-27 11:49
srand.t
1.87
KB
-r--r--r--
2014-12-27 11:49
sselect.t
2.67
KB
-r--r--r--
2014-12-27 11:49
stash.t
9.01
KB
-r--r--r--
2014-12-27 11:49
stat.t
17.51
KB
-r--r--r--
2014-12-27 11:49
state.t
9.72
KB
-r--r--r--
2014-12-27 12:15
study.t
2.99
KB
-r--r--r--
2014-12-27 11:49
studytied.t
1.29
KB
-r--r--r--
2014-12-27 11:49
sub.t
6.54
KB
-r--r--r--
2014-12-27 11:49
sub_lval.t
24.2
KB
-r--r--r--
2014-12-27 11:49
substr.t
20.53
KB
-r--r--r--
2014-12-27 11:49
substr_thr.t
56
B
-r--r--r--
2014-12-27 11:49
svleak.pl
6
B
-r--r--r--
2014-12-27 11:49
svleak.t
15.93
KB
-r--r--r--
2015-01-10 12:06
switch.t
28.06
KB
-r--r--r--
2014-12-27 11:49
symbolcache.t
1.06
KB
-r--r--r--
2014-12-27 11:49
sysio.t
5
KB
-r--r--r--
2014-12-27 11:49
taint.t
66.84
KB
-r--r--r--
2014-12-27 12:32
threads-dirh.t
3.47
KB
-r--r--r--
2014-12-27 11:49
threads.t
9.3
KB
-r--r--r--
2014-12-27 11:49
threads_create.pl
42
B
-r--r--r--
2014-12-27 11:49
tie.t
28.34
KB
-r--r--r--
2014-12-27 11:49
tie_fetch_count.t
11.49
KB
-r--r--r--
2014-12-27 11:49
tiearray.t
4.53
KB
-r--r--r--
2014-12-27 11:49
tiehandle.t
5.27
KB
-r--r--r--
2014-12-27 11:49
time.t
7.86
KB
-r--r--r--
2015-01-17 11:51
time_loop.t
378
B
-r--r--r--
2014-12-27 11:49
tr.t
12.99
KB
-r--r--r--
2014-12-27 11:49
undef.t
3.15
KB
-r--r--r--
2014-12-27 11:49
universal.t
8.32
KB
-r--r--r--
2014-12-27 11:49
unlink.t
1.02
KB
-r--r--r--
2014-12-27 11:49
unshift.t
3.17
KB
-r--r--r--
2014-12-27 11:49
upgrade.t
1.15
KB
-r--r--r--
2014-12-27 11:49
utf8cache.t
3.83
KB
-r--r--r--
2014-12-27 11:49
utf8decode.t
7.59
KB
-r--r--r--
2014-12-27 11:49
utf8magic.t
808
B
-r--r--r--
2014-12-27 11:49
utfhash.t
5.33
KB
-r--r--r--
2014-12-27 11:49
utftaint.t
4.46
KB
-r--r--r--
2014-12-27 11:49
vec.t
2.87
KB
-r--r--r--
2014-12-27 11:49
ver.t
8.39
KB
-r--r--r--
2014-12-27 11:49
waitpid.t
973
B
-r--r--r--
2014-12-27 11:49
wantarray.t
874
B
-r--r--r--
2014-12-27 11:49
warn.t
4.15
KB
-r--r--r--
2014-12-27 11:49
while.t
3.81
KB
-r--r--r--
2014-12-27 11:49
write.t
39.99
KB
-r--r--r--
2015-01-24 15:03
yadayada.t
1.67
KB
-r--r--r--
2015-01-15 22:12
Save
Rename
#!./perl # There are few filetest operators that are portable enough to test. # See pod/perlport.pod for details. BEGIN { chdir 't' if -d 't'; @INC = '../lib'; require './test.pl'; } plan(tests => 53 + 27*14); if ($^O =~ /MSWin32|cygwin|msys/ && !is_miniperl) { require Win32; # for IsAdminUser() } # Tests presume we are in t/op directory and that file 'TEST' is found # therein. is(-d 'op', 1, "-d: directory correctly identified"); is(-f 'TEST', 1, "-f: plain file correctly identified"); isnt(-f 'op', 1, "-f: directory is not a plain file"); isnt(-d 'TEST', 1, "-d: plain file is not a directory"); is(-r 'TEST', 1, "-r: file readable by effective uid/gid not found"); # Make a read only file. This happens to be empty, so we also use it later. my $ro_empty_file = tempfile(); { open my $fh, '>', $ro_empty_file or die "open $fh: $!"; close $fh or die "close $fh: $!"; } chmod 0555, $ro_empty_file or die "chmod 0555, '$ro_empty_file' failed: $!"; SKIP: { my $restore_root; skip "Need Win32::IsAdminUser() on $^O", 1 if $^O =~ /MSWin32|cygwin|msys/ && is_miniperl(); my $Is_WinAdminUser = ($^O =~ /MSWin32|cygwin|msys/ and Win32::IsAdminUser()) ? 1 : 0; # TODO: skip("On an ACL filesystem like $^O we cannot rely on -w via uid/gid"); # We have no filesystem check for ACL in core if ($Is_WinAdminUser) { skip("As Windows Administrator we cannot rely on -w via uid/gid"); } elsif ($> == 0) { # root can read and write anything, so switch uid (may not be # implemented) eval '$> = 1'; skip("Can't drop root privs to test read-only files") if $> == 0; note("Dropped root privs to test read-only files. \$> == $>"); ++$restore_root; } isnt(-w $ro_empty_file, 1, "-w: file writable by effective uid/gid"); if ($restore_root) { # If the previous assignment to $> worked, so should this: $> = 0; note("Restored root privs after testing read-only files. \$> == $>"); } } # these would fail for the euid 1 # (unless we have unpacked the source code as uid 1...) is(-r 'op', 1, "-r: directory readable by effective uid/gid"); is(-w 'op', 1, "-w: directory writable by effective uid/gid"); is(-x 'op', 1, "-x: executable by effective uid/gid"); # Hohum. Are directories -x everywhere? is( "@{[grep -r, qw(foo io noo op zoo)]}", "io op", "-r: found directories readable by effective uid/gid" ); # Test stackability of filetest operators is(defined( -f -d 'TEST' ), 1, "-f and -d stackable: plain file found"); isnt(-f -d _, 1, "-f and -d stackable: no plain file found"); isnt(defined( -e 'zoo' ), 1, "-e: file does not exist"); isnt(defined( -e -d 'zoo' ), 1, "-e and -d: neither file nor directory exists"); isnt(defined( -f -e 'zoo' ), 1, "-f and -e: not a plain file and does not exist"); is(-f -e 'TEST', 1, "-f and -e: plain file and exists"); is(-e -f 'TEST', 1, "-e and -f: exists and is plain file"); is(defined(-d -e 'TEST'), 1, "-d and -e: file at least exists"); is(defined(-e -d 'TEST'), 1, "-e and -d: file at least exists"); isnt( -f -d 'op', 1, "-f and -d: directory found but is not a plain file"); is(-x -d -x 'op', 1, "-x, -d and -x again: directory exists and is executable"); my ($size) = (stat 'TEST')[7]; cmp_ok($size, '>', 1, 'TEST is longer than 1 byte'); is( (-s -f 'TEST'), $size, "-s returns real size" ); is(-f -s 'TEST', 1, "-f and -s: plain file with non-zero size"); # now with an empty file is(-f $ro_empty_file, 1, "-f: plain file found"); is(-s $ro_empty_file, 0, "-s: file has 0 bytes"); is(-f -s $ro_empty_file, 0, "-f and -s: plain file with 0 bytes"); is(-s -f $ro_empty_file, 0, "-s and -f: file with 0 bytes is plain file"); # stacked -l eval { -l -e "TEST" }; like $@, qr/^The stat preceding -l _ wasn't an lstat at /, 'stacked -l non-lstat error with warnings off'; { local $^W = 1; eval { -l -e "TEST" }; like $@, qr/^The stat preceding -l _ wasn't an lstat at /, 'stacked -l non-lstat error with warnings on'; } # Make sure -l is using the previous stat buffer, and not using the previ- # ous op’s return value as a file name. # t/TEST can be a symlink under -Dmksymlinks, so use our temporary file. SKIP: { use Perl::OSType 'os_type'; if (os_type ne 'Unix') { skip "Not Unix", 3 } if ( $^O =~ /android/ ) { # Even the most basic toolbox in android provides ln, # but not which. $ln = "ln"; } else { chomp(my $ln = `which ln`); if ( ! -e $ln ) { skip "No ln" , 3 } } lstat $ro_empty_file; `ln -s $ro_empty_file 1`; isnt(-l -e _, 1, 'stacked -l uses previous stat, not previous retval'); unlink 1; # Since we already have our skip block set up, we might as well put this # test here, too: # -l always treats a non-bareword argument as a file name system 'ln', '-s', $ro_empty_file, \*foo; local $^W = 1; my @warnings; local $SIG{__WARN__} = sub { push @warnings, @_ }; is(-l \*foo, 1, '-l \*foo is a file name'); ok($warnings[0] =~ /-l on filehandle foo/, 'warning for -l $handle'); unlink \*foo; } # More -l $handle warning tests { local $^W = 1; my @warnings; local $SIG{__WARN__} = sub { push @warnings, @_ }; () = -l \*{"\x{3c6}oo"}; like($warnings[0], qr/-l on filehandle \x{3c6}oo/, '-l $handle warning is utf8-clean'); () = -l *foo; like($warnings[1], qr/-l on filehandle foo/, '-l $handle warning occurs for globs, not just globrefs'); tell foo; # vivify the IO slot () = -l *foo{IO}; # (element [3] because tell also warns) like($warnings[3], qr/-l on filehandle at/, '-l $handle warning occurs for iorefs as well'); } # test that _ is a bareword after filetest operators -f 'TEST'; is(-f _, 1, "_ is bareword after filetest operator"); sub _ { "this is not a file name" } is(-f _, 1, "_ is bareword after filetest operator"); my $over; { package OverFtest; use overload fallback => 1, -X => sub { $over = [qq($_[0]), $_[1]]; "-$_[1]"; }; } { package OverString; # No fallback. -X should fall back to string overload even without # it. use overload q/""/ => sub { $over = 1; "TEST" }; } { package OverBoth; use overload q/""/ => sub { "TEST" }, -X => sub { "-$_[1]" }; } { package OverNeither; # Need fallback. Previous versions of perl required 'fallback' to do # -X operations on an object with no "" overload. use overload '+' => sub { 1 }, fallback => 1; } my $ft = bless [], "OverFtest"; my $ftstr = qq($ft); my $str = bless [], "OverString"; my $both = bless [], "OverBoth"; my $neither = bless [], "OverNeither"; my $nstr = qq($neither); open my $gv, "<", "TEST"; bless $gv, "OverString"; open my $io, "<", "TEST"; $io = *{$io}{IO}; bless $io, "OverString"; my $fcntl_not_available; eval { require Fcntl } or $fcntl_not_available = 1; for my $op (split //, "rwxoRWXOezsfdlpSbctugkTMBAC") { $over = []; my $rv = eval "-$op \$ft"; isnt( $rv, undef, "overloaded -$op succeeds" ) or diag( $@ ); is( $over->[0], $ftstr, "correct object for overloaded -$op" ); is( $over->[1], $op, "correct op for overloaded -$op" ); is( $rv, "-$op", "correct return value for overloaded -$op"); my ($exp, $is) = (1, "is"); if ( !$fcntl_not_available and ( $op eq "u" and not eval { Fcntl::S_ISUID() } or $op eq "g" and not eval { Fcntl::S_ISGID() } or $op eq "k" and not eval { Fcntl::S_ISVTX() } ) ) { ($exp, $is) = (0, "not"); } $over = 0; $rv = eval "-$op \$str"; is($@, "", "-$op succeeds with string overloading"); is( $rv, eval "-$op 'TEST'", "correct -$op on string overload" ); is( $over, $exp, "string overload $is called for -$op" ); ($exp, $is) = $op eq "l" ? (1, "is") : (0, "not"); $over = 0; eval "-$op \$gv"; is( $over, $exp, "string overload $is called for -$op on GLOB" ); # IO refs always get string overload called. This might be a bug. $op eq "t" || $op eq "T" || $op eq "B" and ($exp, $is) = (1, "is"); $over = 0; eval "-$op \$io"; is( $over, $exp, "string overload $is called for -$op on IO"); $rv = eval "-$op \$both"; is( $rv, "-$op", "correct -$op on string/-X overload" ); $rv = eval "-$op \$neither"; is($@, "", "-$op succeeds with random overloading"); is( $rv, eval "-$op \$nstr", "correct -$op with random overloading" ); is( eval "-r -$op \$ft", "-r", "stacked overloaded -$op" ); is( eval "-$op -r \$ft", "-$op", "overloaded stacked -$op" ); } # -l stack corruption: this bug occurred from 5.8 to 5.14 { push my @foo, "bar", -l baz; is $foo[0], "bar", '-l bareword does not corrupt the stack'; } # -l and fatal warnings stat "test.pl"; eval { use warnings FATAL => io; -l cradd }; isnt(stat _, 1, 'fatal warnings do not prevent -l HANDLE from setting stat status'); # File test ops should not call get-magic on the topmost SV on the stack if # it belongs to another op. { my $w; sub oon::TIESCALAR{bless[],'oon'} sub oon::FETCH{$w++} tie my $t, 'oon'; push my @a, $t, -t; is $w, 1, 'file test does not call FETCH on stack item not its own'; } # -T and -B my $Perl = which_perl(); SKIP: { skip "no -T on filehandles", 8 unless eval { -T STDERR; 1 }; # Test that -T HANDLE sets the last stat type -l "perl.c"; # last stat type is now lstat -T STDERR; # should set it to stat, since -T does a stat eval { -l _ }; # should die, because the last stat type is not lstat like $@, qr/^The stat preceding -l _ wasn't an lstat at /, '-T HANDLE sets the stat type'; # statgv should be cleared when freed fresh_perl_is 'open my $fh, "test.pl"; -r $fh; undef $fh; open my $fh2, ' . "q\0$Perl\0; print -B _", '', { switches => ['-l'] }, 'PL_statgv should not point to freed-and-reused SV'; # or coerced into a non-glob fresh_perl_is 'open Fh, "test.pl"; -r($h{i} = *Fh); $h{i} = 3; undef %h;' . 'open my $fh2, ' . "q\0" . which_perl() . "\0; print -B _", '', { switches => ['-l'] }, 'PL_statgv should not point to coerced-freed-and-reused GV'; # -T _ should work after stat $ioref open my $fh, 'test.pl'; stat $Perl; # a binary file stat *$fh{IO}; is(-T _, 1, '-T _ works after stat $ioref'); # and after -r $ioref -r *$fh{IO}; is(-T _, 1, '-T _ works after -r $ioref'); # -T _ on closed filehandle should still reset stat info stat $fh; close $fh; -T _; isnt(stat _, 1, '-T _ on closed filehandle resets stat info'); lstat "test.pl"; -T $fh; # closed eval { lstat _ }; like $@, qr/^The stat preceding lstat\(\) wasn't an lstat at /, '-T on closed handle resets last stat type'; # Fatal warnings should not affect the setting of errno. $! = 7; -T cradd; my $errno = $!; $! = 7; eval { use warnings FATAL => unopened; -T cradd }; my $errno2 = $!; is $errno2, $errno, 'fatal warnings do not affect errno after -T BADHADNLE'; } is runperl(prog => '-T _', switches => ['-w'], stderr => 1), "", 'no uninit warnings from -T with no preceding stat'; SKIP: { my $rand_file_name = 'filetest-' . rand =~ y/.//dr; if (-e $rand_file_name) { skip "File $rand_file_name exists", 1 } stat 'test.pl'; -T $rand_file_name; isnt(stat _, 1, '-T "nonexistent" resets stat success status'); } # Unsuccessful filetests on filehandles should leave stat buffers in the # same state whether fatal warnings are on or off. { stat "test.pl"; # This GV has no IO -r *phlon; my $failed_stat1 = stat _; stat "test.pl"; eval { use warnings FATAL => unopened; -r *phlon }; my $failed_stat2 = stat _; is $failed_stat2, $failed_stat1, 'failed -r($gv_without_io) with and w/out fatal warnings'; stat "test.pl"; -r cength; # at compile time autovivifies IO, but with no fp $failed_stat1 = stat _; stat "test.pl"; eval { use warnings FATAL => unopened; -r cength }; $failed_stat2 = stat _; is $failed_stat2, $failed_stat1, 'failed -r($gv_with_io_but_no_fp) with and w/out fatal warnings'; }