Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Perl Idioms Explained - ${\$obj->method} and @{[sort @list]}

by Jenda (Abbot)
on Aug 21, 2003 at 21:04 UTC ( #285592=note: print w/ replies, xml ) Need Help??


in reply to Perl Idioms Explained - ${\$obj->method} and @{[sort @list]}

Why does noone mention Interpolation.pm?

use Interpolation '=' => 'eval'; print "5 + 6 = $={5+6}\n"; print "a regexp object - ", qr[\b (?: $={MATCHES()} ) \b]x, $/; use Interpolation '/' => sub {'$' . $Interpolation::builtin{commify}-> +(@_)}; print "The total is $/{530 * 12.25}\n"; use Interpolation 'S:$$*->$' => 'sprintfX'; print <<"*END*"; dfg sdfg sdfg wearg sdfhg esrg dsf sdf dfg $S{'%.2f %03d'}{37.5}{42} dfgdfg sdfg sdfgsdfg *END* # ouch. I just found a bug in the module. # for this to work you either have to get version newer than 0.69 # or change the 'sprintfX' to 'sprintfx' on line 51 of Interpolation.p +m :-(

Jenda
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
   -- Rick Osborne

Edit by castaway: Closed small tag in signature


Comment on Re: Perl Idioms Explained - ${\$obj->method} and @{[sort @list]}
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (17)
As of 2015-07-31 13:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (278 votes), past polls