Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: issue with print/join 2 arrays

by toolic (Bishop)
on Apr 29, 2014 at 16:36 UTC ( [id://1084351]=note: print w/replies, xml ) Need Help??


in reply to issue with print/join 2 arrays

Slices
use warnings; use strict; my @array1 = (1, 2, 3, 1, 2, 3, 1, 2, 3 ); my @array2 = qw(blue white yellow blue white yellow blue white yellow) +; my $i = 0; while ($i < $#array1) { print "@array1[$i .. $i+2] "; print "@array2[$i .. $i+2]"; print "\n"; $i += 3; } __END__ 1 2 3 blue white yellow 1 2 3 blue white yellow 1 2 3 blue white yellow

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-03-28 08:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found