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

Re: issue with print/join 2 arrays

by roux.tophe (Novice)
on Apr 29, 2014 at 16:48 UTC ( [id://1084354]=note: print w/replies, xml ) Need Help??


in reply to issue with print/join 2 arrays

@array1 = (1, 2, 3, 1, 2, 3, 1, 2, 3 ); @array2 = (blue, white, yellow, blue, white, yellow, blue, white, yell +ow); while (@array1) { (@p1) = (shift(@array1), shift(@array1), shift(@array1)); (@p2) = (shift(@array2), shift(@array2), shift(@array2)); printf("%s %s %s %s %s %s\n", (@p1), (@p2)); }
the idea is to prepare print parameters in @p1 and @p2 before printing them... should be nicer with variables declarations and quotes around bare words (colors...) hope it helps

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-18 12:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found