Lines Matching full:my

9 for my $decl (qw< my CORE::state our local >) {
10 for my $funny (qw< $ @ % >) {
12 # my \$foo my(\$foo) my\($foo) for my \$foo
14 for my $code("$decl \\${funny}x", "$decl\(\\${funny}x\)",
27 my($w,$c);
41 for $decl ('my', 'state', 'our', 'local') {
43 # The weird code that follows uses ~ as a sigil placeholder and MY
45 my $code = '#line ' . (__LINE__+1) . ' ' . __FILE__ . "\n" . <<'END';
46 my $ret = MY \~a;
47 is $ret, \~a, 'MY \$a returns ref to $a';
48 isnt $ret, \~::a, 'MY \$a ret val is not pkg var';
49 my @ret = MY \(~b, ~c);
50 is "@ret", \~b." ".\~c, 'MY \(~b, ~c) returns correct refs';
51 isnt $ret[0], \~::b, 'first retval of MY \(~b, ~c) is not pkg var';
52 isnt $ret[1], \~::c, '2nd retval of MY \(~b, ~c) is not pkg var';
53 @ret = MY (\(~d, ~e));
54 is "@ret", \~d." ".\~e, 'MY (\(~d, ~e)) returns correct refs';
55 isnt $ret[0], \~::d, 'first retval of MY (\(~d, ~e)) is not pkg var';
56 isnt $ret[1], \~::e, '2nd retval of MY (\(~d, ~e)) is not pkg var';
57 @ret = \MY (\~f, ~g);
58 is ${$ret[0]}, \~f, 'first retval of MY (\~f, ~g) is \~f';
59 isnt ${$ret[0]}, \~::f, 'first retval of MY (\~f, ~g) is not \~::f';
60 is $ret[1], \~g, '2nd retval of MY (\~f, ~g) is ~g';
61 isnt $ret[1], \~::g, '2nd retval of MY (\~f, ~g) is not ~::g';
63 is @_, 3, 'MY \~h : risible calls handler with right no. of args';
64 is $_[2], 'risible', 'correct attr passed by MY \~h : risible';
68 unless ('MY' eq 'local') {
70 eval 'MY \~h : risible' or die $@ unless 'MY' eq 'local';
73 eval 'MY \~a ** 1';
75 qr/^Can't (?:declare|modify) exponentiation \(\*\*\) in "?MY"? at/,
76 'comp error for MY \~a ** 1';
77 $ret = MY \\~i;
78 is $$ret, \~i, 'retval of MY \\~i is ref to ref to ~i';
79 $ret = MY \\~i;
80 isnt $$ret, \~::i, 'retval of MY \\~i is ref to ref to ~::i';
81 $ret = MY (\\~i);
82 is $$ret, \~i, 'retval of MY (\\~i) is ref to ref to ~i';
83 $ret = MY (\\~i);
84 isnt $$ret, \~::i, 'retval of MY (\\~i) is ref to ref to ~::i';
86 is @_, 3, 'MY (\~h) : bumpy calls handler with right no. of args';
87 is $_[2], 'bumpy', 'correct attr passed by MY (\~h) : bumpy';
91 unless ('MY' eq 'local') {
93 eval 'MY (\~h) : bumpy' or die $@;
98 $code =~ s/MY/$decl/g;
109 for $decl ('my', 'state', 'our') {
111 my $code = '#line ' . (__LINE__+1) . ' ' . __FILE__ . "\n" . <<'ENE';
112 for MY \~x (\~::y) {
113 is \~x, \~::y, '\~x aliased by for MY \~x';
118 $code =~ s/MY/$decl/g;