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

Re: No: of values in a hashtable

by AnomalousMonk (Canon)
on Sep 17, 2012 at 20:19 UTC ( #994092=note: print w/replies, xml ) Need Help??


in reply to No: of values in a hashtable

Sometimes it's very helpful to write a small example (as you have done in your OP) and see the result. Data::Dumper and Data::Dump are very useful for this.

>perl -wMstrict -le "use Data::Dumper; ;; my %hash; ;; push @{ $hash{'one'} }, qw(fee fie foe fum), undef, 'oops'; print Dumper \%hash; ;; my $defined_pushed = grep defined, @{ $hash{'one'} }; print $defined_pushed; " $VAR1 = { 'one' => [ 'fee', 'fie', 'foe', 'fum', undef, 'oops' ] }; 5

See also Basic debugging checklist.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://994092]
help
Chatterbox?
[LanX]: I like http://www.comedix .de/lexikon/db/ nihamavasah.php = never have we water and http://www.comedix .de/lexikon/db/ erindjah.php = Air India xD
[LanX]: work!
[LanX]: thats very strange, I try to change two columns to "unique" and MySQL is complaining even that the data is already unique ???
[karlgoethebier]: Angie Singing
[karlgoethebier]: OK, OT

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (15)
As of 2017-05-24 15:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?