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

Re: The new =~, and chaining statement modifiers

Thread Previous | Thread Next
Larry Wall
April 3, 2002 17:53
Re: The new =~, and chaining statement modifiers
Message ID:
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.  :-)


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