Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: (jeffa) Re: Question about using hash indexes with GD::Graph

by extremely (Priest)
on Mar 21, 2001 at 02:43 UTC ( [id://65870] : note . print w/replies, xml ) Need Help??


in reply to (jeffa) Re: Question about using hash indexes with GD::Graph
in thread Question about using hash indexes with GD::Graph

merlyn showed ya map but honestly you shouldn't get into the habit of traipsing through a data set multiple times. When ever you see two lines that both end "foreach (@array)" you should be doing:
foreach (@data) { push @h, $_->{'hour'}; push @c, $_->{'count'); }

You get in a hurry and do it wrong then wind up going through the same data like 7 or 8 times when there are 100,000 items in the list and you are going start wondering where your afternoon of surfing PM went. =P

--
$you = new YOU;
honk() if $you->love(perl)