Lines Matching full:my

72   my $x = if if if;
75 my $y = if if if;
89 my $called;
210 my $x = if if if;
213 my $y = if if if;
232 my $x = shift;
243 # tion of a named sub to another (i.e., that they are not my subs).
250 my $x = shift;
257 my $poom = foom(27);
258 my $poom2 = foom(678);
260 'state subs close over the first outer my var, like pkg subs';
261 my $x = 43;
281 my $s = make_anon_with_state_sub;
318 my $sub = sub {
321 my $x;
351 p(my @a);
352 p my @b;
481 # -------------------- my -------------------- #
484 my sub foo { 44 }
485 isnt \&::foo, \&foo, 'my sub is not stored in the package';
486 is foo, 44, 'calling my sub from same package';
487 is &foo, 44, 'calling my sub from same package (amper)';
489 is foo, 44, 'calling my sub from another package';
490 is &foo, 44, 'calling my sub from another package (amper)';
493 is foo, 43, 'my sub falling out of scope';
494 is &foo, 43, 'my sub falling out of scope (called via amper)';
497 my sub ma {
499 is ma, 43, 'my sub invisible inside itself';
500 is &ma, 43, 'my sub invisible inside itself (called via amper)';
506 my sub mb;
507 my sub mb {
509 # ‘my sub foo{}’ creates a new pad entry, not reusing the forward
513 'my sub foo {} after forward declaration';
516 'my sub foo {} after forward declaration (amper)';
522 my sub sb2;
526 is mb2, 44, 'my sub visible inside itself after decl';
527 is &mb2, 44, 'my sub visible inside itself after decl (amper)';
532 my sub mb3;
534 my sub mb3 { # new pad entry
541 'sub foo{} applying to "my sub foo;" even inside my sub foo{}';
544 my sub mb4;
546 my sub mb4 {
551 'sub foo{} applying to "my sub foo;" even inside my sub foo{}';
556 my sub mc;
559 'my sub foo; makes no lex alias for existing sub';
562 'my sub foo; makes no lex alias for existing sub (amper)';
566 my sub me ($);
567 is prototype eval{\&me}, '$', 'my sub with proto';
568 is prototype "me", undef, 'prototype "..." ignores my subs';
570 my $coderef = eval "my sub foo (\$\x{30cd}) {1}; \\&foo";
571 my $proto = prototype $coderef;
572 ok(utf8::is_utf8($proto), "my sub with UTF8 proto maintains the UTF8ness");
576 my sub if() { 44 }
577 my $x = if if if;
578 is $x, 44, 'my subs override all keywords';
580 my $y = if if if;
581 is $y, 44, 'my subs from other packages override all keywords';
585 my $w ;
588 my sub lexsub2;
589 my sub lexsub2 {};
592 '"my" subroutine &lexsub2 masks earlier declaration in same scope at '
594 'warning for my sub masking earlier declaration';
596 # Test that my subs are cloned inside anonymous subs.
598 my $x = shift;
600 my sub foo { $x }
606 is &$sub1, 48, 'my sub in closure (1)';
607 is &$sub2, 49, 'my sub in closure (2)';
611 my $w;
615 my $x = shift;
616 my sub poom { $x }
620 is $w, undef, 'my subs get no "Variable will not stay shared" messages';
621 my $poom = mfoom(27);
622 my $poom2 = mfoom(678);
623 is $poom->(), 27, 'my subs closing over outer my var (1)';
624 is $poom2->(), 678, 'my subs closing over outer my var (2)';
625 my $x = 43;
626 my sub aoeu;
628 my sub etetetet { $x }
630 is etetetet, 765, 'my sub respects for() localisation';
634 # And we also need to test that multiple my subs can close over each
639 my sub s1;
640 my sub s2 { \&s1 }
643 is eval{s1},eval{\&s2}, 'my sub in anon closure closing over sibling my sub';
644 is eval{s2},eval{\&s1}, 'my sub in anon closure closing over sibling my sub';
648 # Test my subs inside predeclared my subs
650 my sub s2;
652 my $x = 3;
653 my sub s3 { eval '$x' }
656 is s2, 3, 'my sub inside predeclared my sub';
660 my $s = make_anon_with_my_sub;
663 # And make sure the my subs were actually cloned.
665 'my subs in anon subs are cloned';
669 my sub BEGIN { exit };
670 pass 'my subs are never special blocks';
671 my sub END { shift }
673 'my sub END {shift} implies @_, not @ARGV';
676 my sub redef {}
678 my $w;
682 "sub redefinition warnings from my subs";
686 my sub x {};
697 my sub x{}
708 my sub x {};
715 my($f,$l) = (__FILE__,__LINE__ - 1);
723 my sub foo;
726 my sub bar {
727 my $x = 'khaki car keys for the khaki car';
739 my sub p (\@) {
740 is ref $_[0], 'ARRAY', 'my sub with proto';
742 p(my @a);
744 my sub q () { 46 }
745 is q(), 46, 'my constant called with parens';
748 my sub x;
749 my $count;
752 is $count, 11, 'my recursive subs';
755 my sub x;
757 is x, 3, 'my sub defined inside eval';
759 my sub z;
761 is z, 4, 'my sub defined in BEGIN { eval "..." }';
767 eval q{ my sub george () { 2 } };
768 is $w, undef, 'no double free from constant my subs';
772 prog => 'my sub a { foo ref } a()',
776 'referencing a my sub after a syntax error does not crash';
780 my sub foo{ $stuff .= our $AUTOLOAD }
784 is $stuff, 'A::bar', 'my sub assigned to *AUTOLOAD can autoload';
787 my sub quire{qr "quires"}
789 ok "quires" =~ bless([], mo::), 'my sub used as overload method';
792 my sub foo;
796 is foo, 42, 'defining my sub body via package sub declaration';
799 my sub foo;
806 pass "pad taking ownership once more of packagified my-sub";
820 my sub foo {print qq|2\n|}
827 'my subs and DB::sub under -d'
832 prog => 'my sub x {}; undef &x; print defined &x',
833 stderr => 1), "\n", 'undefining my sub';
835 my sub x { is +(caller 0)[3], 'x', 'my sub name in caller' }
839 my sub _cmp { $b cmp $a }
844 my sub handel { "" }
845 print handel,"ok ",curr_test()," - no 'No comma allowed' after my sub\n";
849 my $x = 43;
850 my sub y :prototype() {$x};
851 is y, 43, 'my sub that looks like constant closure';
855 my sub φου;
858 'my sub with utf8 name';
861 my $w;
864 eval 'sub stayshared { my sub x; sub notstayshared { x } } 1' or die;
872 my sub s1;
873 my sub s2 { 3 };
876 }->()(), 3, 'state sub inside my sub closing over my sub uncle';
879 my sub s2 { 3 };
881 is not_lexical->(), 3, 'state subs that reference my sub from outside';
884 # Test my subs inside predeclared package subs
889 my $x = 23;
890 my sub bar;
897 is not_lexical3, 23, 'my subs inside predeclared package subs';
899 # Test my subs inside predeclared package sub, where the lexical sub is
904 my sub foo;
907 my $x = 234;
914 'my sub defined in predeclared pkg sub but declared outside';
918 my sub foo;
924 eval 'sub not_lexical7 { my @x }';
926 my sub foo;
939 prog => 'my sub foo; sub foo { foo } foo',
947 prog => 'my sub foo() { 42 } undef &foo',
954 my sub foo;
967 my sub h; sub{my $x; sub{h}}
970 is join("-", qw(aa bb), do { my sub lleexx; 123 }, qw(cc dd)),
971 "aa-bb-123-cc-dd", 'do { my sub...} in a list [perl #132442]';
988 my $x = shift;
989 my sub b { $x };
996 my ($x, $name) = @_;
998 my sub b;
1000 # provides definition for my sub b
1015 my ($value, $callback) = @_;
1018 my sub inner {
1029 my $result =
1031 my $arg = shift;