Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: passing token output to a variable (parens force assignment before substitution)

by Anonymous Monk
on Jan 06, 2013 at 07:57 UTC ( #1011844=note: print w/ replies, xml ) Need Help??


in reply to passing token output to a variable

to see your program how perl sees it run

perl -MO=Deparse,-p foo.pl

Then write that expression as

( $cleaned = $token->as_is ) =~ s/\s{2,}/ /gs;

parens force assignment before substitution


Comment on Re: passing token output to a variable (parens force assignment before substitution)
Re^2: passing token output to a variable (parens force assignment before substitution)
by SilverShadow (Initiate) on Jan 06, 2013 at 18:51 UTC
    Thanks, I will try that

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2015-07-05 15:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (67 votes), past polls