Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: Using 2d hash to print a matrix

by atcroft (Monsignor)
on Oct 28, 2011 at 21:40 UTC ( #934520=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Using 2d hash to print a matrix
in thread Using 2d hash to print a matrix

You don't need the 'q{ }' in the line then. The join() command assembles a single string from the second and following parameters using the first parameter as a separator. So, if you said $str = join(q{asdf}, 1, ( 2, 4, 6 ));, then $str would contain '1asdf2asdf4asdf6', or if you said $str = join(q{|}, qw/a s d f z x c v/);, $str would contain 'a|s|d|f|z|x|c|v'. In the line you mention, there would be a space, followed by a tab character, then the value of $k, then a tab character, then the values in @data, separated by tab characters.

Hope that helps.


Comment on Re^3: Using 2d hash to print a matrix
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (10)
As of 2015-07-08 07:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (96 votes), past polls