Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^4: create a matrix for print 0 or 1 from pairing

by jakobi (Pilgrim)
on Oct 29, 2009 at 09:48 UTC ( [id://803917]=note: print w/replies, xml ) Need Help??


in reply to Re^3: create a matrix for print 0 or 1 from pairing
in thread create a matrix for print 0 or 1 from pairing

change lines 5+6 to my %A; my @order=qw/horse lion mule tiger/;

Keywords to check are: soft references and auto-vivification: your strings 'a' to 'd' can be abused as soft references, which happens without use strict. With use strict however, you need a real hash-ref in the elements of %A instead - see perlreftut for more on references and soft references. Or omit the initialization of your hash-of-hashes %A to autovivify any undef values automagically as required (Autovivify definition or again: perlreftut).

and for your aligning your table layout, consider something like sprintf "%5s", $stringvariable

cu & HTH, Peter -- hints may be untested unless stated otherwise; use with caution & understanding.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-20 08:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found