Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: [Solved] Printing a 2D array into constant-sized columns

by hazylife (Monk)
on Apr 01, 2014 at 15:01 UTC ( [id://1080583]=note: print w/replies, xml ) Need Help??


in reply to [Solved] Printing a 2D array into constant-sized columns

Obviously printf/sprintf is the way to go, but there are other options:
#!/usr/bin/perl use strict; my @accounts = ( [ current => 1000 ], [ savings => 2000 ], [ other => 500 ], ); write for @accounts; format STDOUT = @<<<<<<< | @<<<<<<< $_->[0], $_->[1] # EDIT: or just @$_ .

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-03-28 17:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found