diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-02-19 05:08:29 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-02-19 05:08:29 +0000 |
commit | 2ba6ecf407bef45da384c153231c33d524202d81 (patch) | |
tree | d7b5cac0ecb692368fd1da2e4593a2ee5291a66f /t/comp | |
parent | d8118cadc52d40e092e6844d95847fefa280a0db (diff) | |
download | perl-2ba6ecf407bef45da384c153231c33d524202d81.tar.gz |
bring '*' prototype closer to how it behaves internally
p4raw-id: //depot/perl@2978
Diffstat (limited to 't/comp')
-rwxr-xr-x | t/comp/proto.t | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/t/comp/proto.t b/t/comp/proto.t index 084e0ab715..d58a7821d8 100755 --- a/t/comp/proto.t +++ b/t/comp/proto.t @@ -16,7 +16,7 @@ BEGIN { use strict; -print "1..82\n"; +print "1..87\n"; my $i = 1; @@ -413,3 +413,13 @@ sub X::foo4 ($); *X::foo4 = sub ($) {'ok'}; print "not " unless X->foo4 eq 'ok'; print "ok ", $i++, "\n"; + +# test if the (*) prototype allows barewords, constants, scalar expressions, +# globs and globrefs (just as CORE::open() does), all under stricture +sub star (*&) { &{$_[1]} } +my $star = 'FOO'; +star FOO, sub { print "ok $i\n" if $_[0] eq 'FOO' }; $i++; +star "FOO", sub { print "ok $i\n" if $_[0] eq 'FOO' }; $i++; +star $star, sub { print "ok $i\n" if $_[0] eq 'FOO' }; $i++; +star *FOO, sub { print "ok $i\n" if $_[0] eq \*FOO }; $i++; +star \*FOO, sub { print "ok $i\n" if $_[0] eq \*FOO }; $i++; |