Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: How can we interpolate an expression??

by Kenosis (Priest)
on Sep 20, 2012 at 18:42 UTC ( #994726=note: print w/ replies, xml ) Need Help??


in reply to Re^2: How can we interpolate an expression??
in thread How can we interpolate an expression??

Great understanding!

say "Product is @{[$number * $multiplier]}"; ^ ^ ^ ^ | | | | | | | + - EXPRESSION | | + - reference | + - dereference + - interpolate


Comment on Re^3: How can we interpolate an expression??
Download Code
Re^4: How can we interpolate an expression??
by tobyink (Abbot) on Sep 20, 2012 at 20:37 UTC

    It's such a common combination of operations that it's even got a name: the baby cart.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

      Excellent, tobyink! I enjoy what it says there:

      Discovered by Larry Wall, 1994.

      It's the Discovered part that's intriguing...

        A number of Perl's "features" are actually bugs that were discovered, found to be useful and have been documented and carefully preserved. One that springs to mind is that s/.../.../ee evaluates twice, s/.../.../eee evaluates thrice, etc.

        I have a feeling that the baby cart is one of these.

        perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2014-09-22 08:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (184 votes), past polls