Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 surveying the Monastery: (5)
As of 2014-12-25 15:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (160 votes), past polls