Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: printing arrays

by johngg (Canon)
on Dec 31, 2008 at 16:15 UTC ( [id://733495]=note: print w/replies, xml ) Need Help??


in reply to printing arrays

TIMTOWTDI again! You can use the default behaviour that separates array or list elements with a space in double-quoted strings. This construct, @{ [ ... ] }, allows you to interpolate bits of code inside double-quoted strings.

$ perl -e ' @ids = qw{ 123 456 789 }; @names = qw{ ann joe flo }; print qq{@{ [ map qq{$ids[ $_ ] $names[ $_ ]}, 0 .. $#ids ] }\n};' 123 ann 456 joe 789 flo $

I hope this is of interest.

Cheers,

JohnGG

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-20 01:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found