Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: In an array of arrays, how do I print the whole array or bits of it?

by indigo (Scribe)
on Aug 30, 2000 at 21:50 UTC ( #30356=note: print w/replies, xml ) Need Help??


in reply to In an array of arrays, how do I print the whole array or bits of it?

Basically, you write a program to do what you want. :) See the previous respondant for examples. Perl has number of builtins to facilitate array operations, such as foreach, map, and grep. For example, if you have a blended array of values and references, you can do this:
my @lol = ([1, 2, 3], 'x', [qw(A B C)], 'foo'); print join "\n", map {ref $_ ? join ', ', @$_ : $_} @lol;
Additionally, you may wish to look at the Data::Dumper module, which can display complex data structures in a human readable format.
  • Comment on Re: In an array of arrays, how do I print the whole array or bits of it?
  • Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2022-07-05 22:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?