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

Re: printing arrays

by Perlbotics (Archbishop)
on Dec 31, 2008 at 14:57 UTC ( [id://733480]=note: print w/replies, xml ) Need Help??


in reply to printing arrays

TIMTOWTDI: Limits the output to the shortest sequence but comes at the cost of an implicite extra-array...

use strict; use warnings; my @ID = qw(123 456 789 666); my @name = qw(Smith Doe Allen); my $line = join(' ', map { $ID[$_], $name[$_] } 0..($#ID < $#name ? $#ID : $#name) ); print "($line)\n"; #output: (123 Smith 456 Doe 789 Allen)

Log In?
Username:
Password:

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

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

    No recent polls found