Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: No: of values in a hashtable

by AnomalousMonk (Chancellor)
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]
[choroba]: Maybe the first four got downvoted and were deleted from the list?
LanX what?
marto deletes himself from the all lists
QM deletes himself from all delete lists

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2018-03-20 10:10 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (249 votes). Check out past polls.