11 # test various operations on @_
13 sub new1 { bless \@_ }
21 sub new2 { splice @_, 0, 0, "a", "b", "c"; return \@_ }
29 sub new3 { goto &new1 }
37 sub new4 { goto &new2 }
45 # see if POPSUB gets to see the right pad across a dounwind() with
58 eval { method('foo', 'bar'); };
65 # bug #21542 local $_[0] causes reify problems and coredumps
67 sub local1 { local $_[0] }
68 my $foo = 'foo'; local1($foo); local1($foo);
69 print "got [$foo], expected [foo]\nnot " if $foo ne 'foo';
72 sub local2 { local $_[0]; last L }
76 # the following test for local(@_) used to be in t/op/nothr5005.t (because it
77 # failed with 5005threads)
81 sub foo { local(@_) = ('p', 'q', 'r'); }
82 sub bar { unshift @_, 'D'; @_ }
83 sub baz { push @_, 'E'; return @_ }
85 is(join('',foo('a', 'b', 'c')),'pqr');
86 is(join('',bar('d')),'Dd');
87 is(join('',baz('e')),'eE');
90 # [perl #28032] delete $_[0] was freeing things too early
94 sub X::DESTROY { $flag = 1 }
97 ok(!$flag, 'delete $_[0] : in f');
100 my $x = bless [], 'X';
102 ok(!$flag, 'delete $_[0] : after f');
104 ok($flag, 'delete $_[0] : outside block');