Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: multidimensional array printing

by Anonymous Monk
on Aug 26, 2012 at 17:31 UTC ( #989852=note: print w/replies, xml ) Need Help??


in reply to Re: multidimensional array printing
in thread multidimensional array printing

Why not simply like this:
print "START: Interface report on $hostname\n"; print join(" ", map @{$_}, @dat) . "\n"; print "END: Interface report on $hostname\n";

Replies are listed 'Best First'.
Re^3: multidimensional array printing
by Anonymous Monk on Aug 26, 2012 at 17:34 UTC
    Or much simple:
    print "@{$_}\n" for @dat;
Re^3: multidimensional array printing
by chanslor (Acolyte) on Sep 01, 2012 at 03:23 UTC
    Almost there, here is the output with your suggestion:
    START: Interface report on host1 hme0 UP xxx.xxx.xxx.xxx hostname hme1 UP xxx.xxx.xxx.xxx hostname END: Interface report on host1
    I need to figure out when a new interface come by and give a new line...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://989852]
help
Chatterbox?
erix prods ambrus to (re-)start cbstream...
[GotToBTru]: I've got a program with an if ... or ... statement with 80 clauses
[stevieb]: 80 clauses? dispatch table?
[GotToBTru]: no, lookup
[stevieb]: no, I mean have you considered using a dispatch table. an 80 condition if/else is huge :)
[GotToBTru]: that is how this should have been done, no question
[GotToBTru]: probably back when there were 5 or so clauses

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2017-06-22 13:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (519 votes). Check out past polls.