Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Perl: the Markov chain saw
 
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 rifling through the Monastery: (9)
As of 2014-04-16 11:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (424 votes), past polls