Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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

by tobyink (Abbot)
on Sep 20, 2012 at 20:37 UTC ( #994750=note: print w/replies, xml ) Need Help??

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

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'
  • Comment on Re^4: How can we interpolate an expression??

Replies are listed 'Best First'.
Re^5: How can we interpolate an expression??
by Kenosis (Priest) on Sep 21, 2012 at 02:46 UTC

    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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://994750]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2018-01-16 09:34 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (175 votes). Check out past polls.