develooper Front page | perl.perl5.porters | Postings from November 2014

[perl #47363] \@ prototypes and anonymous scalar refs

From:
Father Chrysostomos via RT
Date:
November 25, 2014 13:39
Subject:
[perl #47363] \@ prototypes and anonymous scalar refs
Message ID:
rt-4.0.18-2771-1416922738-1725.47363-15-0@perl.org
On Sun Nov 11 17:45:29 2007, webmasters ctosonline.org wrote:
> (Assume these examples all begin with 'use Data::Dumper'.)
> 
> This doesn't cause a parse error. Instead, it passes a reference to an
> anon scalar to &foo:
> 	sub foo(\@) { print Dumper @_ }; foo((@foo))
> as does this:
> 	sub foo(\@) { print Dumper @_ }; foo+(@foo)
> But these three work fine:
> 	sub foo(\@) { print Dumper @_ }; foo+@foo
> 	sub foo(\@) { print Dumper @_ }; foo(+@foo)
> 	sub foo(\@) { print Dumper @_ }; foo(+ +@foo)

Fixed in 0c46edc.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=47363



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About