develooper Front page | perl.perl6.language | Postings from April 2002

Re: The new =~, and chaining statement modifiers

Thread Previous | Thread Next
From:
Larry Wall
Date:
April 3, 2002 17:53
Subject:
Re: The new =~, and chaining statement modifiers
Message ID:
200204040149.RAA11791@wall.org
Luke Palmer writes:
: So, does the new =~ commute now, except for regexps; i.e.
: 
: $a =~ $b
: is the same as
: $b =~ $a
: 
: unless one or both are regexps?

I believe I marked which ones commute in A4.

: Additionally, can you chain statement modifiers?
: 
: do_this() if $a unless $b;
: print for @mylist if $debug;
: 	or less efficiently,
: print if $debug for @mylist;
: print "$x, $y" for @xlist -> $x for @ylist -> $y;

No, still can't chain them.

: Or is this for syntax even valid?:   (question colon not meant as ternary ;)
: print "$x" for @xlist -> $x;

Nope.  You only get implicit $_ with the for modifier.

: If you can't, it might be something to consider.

Did.  :-)

Larry

Thread Previous | 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