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

[perl #116020] toggle operator missing reset: proposal

Thread Previous
tlhackque via RT
December 11, 2012 02:31
[perl #116020] toggle operator missing reset: proposal
Message ID:
Fair observation.

Other syntax would work - pehaps "reset [label]" ?  

Surely an arrayref is currently a nonsensical argument to reset...which 
is what this would look like to current Perl.  To make it easy to 
parse, we could even say reset ['label'] - so no special handling in 
the []s.

I'm not a Perl internals person, so certainly other ideas will come to 
more internals-savvy folks.  

I'm just hoping that some variant of this will take someone's fancy who 
can implement it and remove this long-standing restriction in the 

On Mon Dec 10 07:51:43 2012, davem wrote:
> On Sat, Dec 08, 2012 at 03:56:33AM -0800, via RT wrote:
> >   Since we can label any statement (now), why not have the reset
> operator take a label argument?
> >   Then reset can act on the toggle(s) in that statement.
> >
> >   So the minimum implemention would permit:
> > sub extract {
> >    my $out = '';
> >    reset TOGGLE;
> but C<reset TOGGLE> currently means the same as C<reset "TOGGLE">
> (which means the same as C<reset "EGLOT">).

via perlbug:  queue: perl5 status: open

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About