Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: The value of pattern match variable $&

by ikegami (Patriarch)
on May 15, 2006 at 15:12 UTC ( #549530=note: print w/replies, xml ) Need Help??


in reply to Re^2: The value of pattern match variable $&
in thread The value of pattern match variable $&

That doens't quite explain it. It the first loop, it's as if the implicit local $& is outside of the loop — It prints 'bar' on the 'baz' pass of the loop — while in the second loop, it's as is the implicit local $& is inside of the loop.

Could
print "$&\n" unless /bar/;
suffer from a problem similar to the one from which
my ... if ...;
suffers?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://549530]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2022-05-21 22:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (78 votes). Check out past polls.

    Notices?