From: M. J. T. Guy Date: Thu, 30 Jul 1998 12:18:15 +0000 (+0100) Subject: add test for magic autovivification X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=19a09eb8fc52598025e90f4c4f688a3db0626154;p=p5sagit%2Fp5-mst-13.2.git add test for magic autovivification Message-Id: Subject: Re: Perl5.005_01 failing to autovivify subroutine args p4raw-id: //depot/maint-5.005/perl@1704 --- diff --git a/pod/perldiag.pod b/pod/perldiag.pod index ccef016..8d21323 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -1538,7 +1538,7 @@ backwards. =item Modification of non-creatable hash value attempted, subscript "%s" -(F) You tried to make a hash value spring into existence, and it couldn't +(P) You tried to make a hash value spring into existence, and it couldn't be created for some peculiar reason. =item Module name must be constant diff --git a/t/cmd/subval.t b/t/cmd/subval.t index 3c1ffb8..3c60690 100755 --- a/t/cmd/subval.t +++ b/t/cmd/subval.t @@ -33,7 +33,7 @@ sub foo6 { 'true2' unless $_[0]; } -print "1..34\n"; +print "1..36\n"; if (&foo1(0) eq '0') {print "ok 1\n";} else {print "not ok 1 $foo\n";} if (&foo1(1) eq 'true2') {print "ok 2\n";} else {print "not ok 2\n";} @@ -177,3 +177,10 @@ sub iseof { eof UNIQ ? print "not ok $main'i\n" : print "ok $main'i\n"; } } + +sub autov { $_[0] = 23 }; + +my $href = {}; +print keys %$href ? 'not ' : '', "ok 35\n"; +autov($href->{b}); +print join(':', %$href) eq 'b:23' ? '' : 'not ', "ok 36\n";