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

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?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2016-09-28 14:00 GMT
Find Nodes?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:

    Results (531 votes). Check out past polls.