diff options
author | Gurusamy Sarathy <gsar@engin.umich.edu> | 1996-09-04 02:54:56 +0000 |
---|---|---|
committer | Andy Dougherty <doughera@lafcol.lafayette.edu> | 1996-09-04 02:54:56 +0000 |
commit | 58e0a6aef843ff1011481f826c2a83b86bc9e67a (patch) | |
tree | 4d3657d456e0e76435a341feda756e3c551f8a46 /t/op/ref.t | |
parent | d8d253f04ead39466658b138fa78f1ec8e7fc42a (diff) | |
download | perl-58e0a6aef843ff1011481f826c2a83b86bc9e67a.tar.gz |
Re: \ ( @array ) busted for lexical @array (once more)
Diffstat (limited to 't/op/ref.t')
-rwxr-xr-x | t/op/ref.t | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/t/op/ref.t b/t/op/ref.t index 38e34f002b..0787295dde 100755 --- a/t/op/ref.t +++ b/t/op/ref.t @@ -1,6 +1,6 @@ #!./perl -print "1..41\n"; +print "1..47\n"; # Test glob operations. @@ -189,12 +189,30 @@ sub foo { print $_[1] } package WHATEVER; foo WHATEVER "ok 38\n"; +# +# test the \(@foo) construct +# +package main; +@foo = (1,2,3); +@bar = \(@foo); +@baz = \(1,@foo,@bar); +print @bar == 3 ? "ok 39\n" : "not ok 39\n"; +print grep(ref($_), @bar) == 3 ? "ok 40\n" : "not ok 40\n"; +print @baz == 3 ? "ok 41\n" : "not ok 41\n"; + +my(@fuu) = (1,2,3); +my(@baa) = \(@fuu); +my(@bzz) = \(1,@fuu,@baa); +print @baa == 3 ? "ok 42\n" : "not ok 42\n"; +print grep(ref($_), @baa) == 3 ? "ok 43\n" : "not ok 43\n"; +print @bzz == 3 ? "ok 44\n" : "not ok 44\n"; + package FINALE; { - $ref3 = bless ["ok 41\n"]; # package destruction - my $ref2 = bless ["ok 40\n"]; # lexical destruction - local $ref1 = bless ["ok 39\n"]; # dynamic destruction + $ref3 = bless ["ok 47\n"]; # package destruction + my $ref2 = bless ["ok 46\n"]; # lexical destruction + local $ref1 = bless ["ok 45\n"]; # dynamic destruction 1; # flush any temp values on stack } |