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

Re: multi-dimensional arrays, dereferencing

by thinker (Parson)
on Aug 08, 2003 at 12:12 UTC ( [id://282164]=note: print w/replies, xml ) Need Help??


in reply to multi-dimensional arrays, dereferencing

Hi fabalicious

As an aside, and this is merely a matter of style, your method of doing what you want to do is very verbose.

I would choose to write it as

print "@$_\n" for @M;

taking advantages of some of some not so intuitive Perl idioms, like using @$_ to dereference each array, and the fact that "@array" will join the elements of @array with $", which is a space by default. And it saves you printing an extra space character at the end of each line :-)

In the spirit of TMTOWTDI

cheers

thinker

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-09-18 12:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (24 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.