Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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)

Replies are listed 'Best First'.
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: (3)
As of 2016-10-01 23:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?






    Results (9 votes). Check out past polls.