go ahead... be a heretic | |
PerlMonks |
Re: goto HACKby cavac (Parson) |
on Sep 25, 2018 at 09:30 UTC ( [id://1222955]=note: print w/replies, xml ) | Need Help?? |
If you only have timestamps, you can just count them:
Results:
On the other hand, if you have data associated with the timestamps, you can just push that data into an array associated with that specific timestamp inside the hash. Sounds complicated, but it isn't:
And here is the result:
Edit: If you want to avoid temporary variables, you can also make the main loop faster but harder to read:
"For me, programming in Perl is like my cooking. The result may not always taste nice, but it's quick, painless and it get's food on the table."
In Section
Seekers of Perl Wisdom
|
|