Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Counter - number of tags per interval

by LanX (Saint)
on May 04, 2013 at 10:59 UTC ( [id://1032027]=note: print w/replies, xml ) Need Help??


in reply to Counter - number of tags per interval

From what I can see your code is not only hard to read but also conceptually wrong.

Your using the 3rd level of %hash_pos at the same time for indicating the interval stop

foreach my $o (keys %{$hash_pos{$id}->{$p}}){ $hash_stop{$p}->{$o}=1;

AND for counting

             $hash_pos{$id}->{$keyu}->{$key}++ if $2 eq '1';

Thats why each count is interpreted as a new stop, resulting in exponentially growing run-time!

As another consequence the results should be plain wrong.

Did you check them before posting?

Update

Not sure anymore, this code is really too hard to read!

Please try more descriptive and consistent variable names!

Cheers Rolf

( addicted to the Perl Programming Language)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-26 05:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found