Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: Perl Idioms Explained - @ary = $str =~ m/(stuff)/g

by tachyon (Chancellor)
on Sep 15, 2003 at 14:02 UTC ( #291558=note: print w/replies, xml ) Need Help??


in reply to Re: Perl Idioms Explained - @ary = $str =~ m/(stuff)/g
in thread Perl Idioms Explained - @ary = $str =~ m/(stuff)/g

To be completely pedantic the reason it 'works' is that they coded it that way! The reason it works without needing parens is as you say.

The precedence order is why you need to do stuff like this:

(my $fix_up = $old_str ) =~ s/this/that/g;

But that is another idiom I guess. This one lets you set declare $fix_up, set it to $old_str, and then modify $fix_up in one line, while leaving $old_str intact for future reference.....

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://291558]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2016-12-08 19:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (144 votes). Check out past polls.