Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: String interpolation

by fglock (Vicar)
on Dec 09, 2004 at 13:03 UTC ( [id://413515]=note: print w/replies, xml ) Need Help??


in reply to String interpolation

use strict; my $str = sub { "params.$_[0].arg" }; sub do_something { print +shift, "\n" } for my $idx (0..10) { do_something( $str->($idx) ); }

output:

params.0.arg params.1.arg params.2.arg params.3.arg params.4.arg params.5.arg params.6.arg params.7.arg params.8.arg params.9.arg params.10.arg

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2024-04-19 12:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found