develooper Front page | perl.perl5.porters | Postings from January 2012

[perl #109132] sub foo(_@)

Thread Next
From:
Father Chrysostomos via RT
Date:
January 26, 2012 12:29
Subject:
[perl #109132] sub foo(_@)
Message ID:
rt-3.6.HEAD-14510-1327609749-1160.109132-15-0@perl.org
On Thu Jan 26 11:40:59 2012, ikegami@adaelis.com wrote:
> This is a bug report for perl from ikegami@adaelis.com,
> generated with the help of perlbug 1.39 running under perl 5.14.0.
> 
> 
> -----------------------------------------------------------------
> [Please describe your issue here]
> 
> $ perl -we'sub foo(_@) {}'
> Illegal character after '_' in prototype for main::foo : _@ at -e line
> 1.
> 
> $ perl -we'sub foo(_;@) {}'
> 
> $ perl -we'sub foo(_%) {}'
> Illegal character after '_' in prototype for main::foo : _% at -e line
> 1.
> 
> $ perl -we'sub foo(_;%) {}'
> 
> $
> 
> I don't see why "and 0 or more arguments" is treated differently than
> "and
> optionally 0 or more arguments".

If we allow _@, then it becomes more complicated to explain why _$ is
not allowed.

-- 

Father Chrysostomos


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

Thread Next


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