Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: My excessive and redundant code<333by bobf (Monsignor) |
on Jun 23, 2005 at 04:07 UTC ( [id://469285]=note: print w/replies, xml ) | Need Help?? |
If it works and it is readable, I wouldn't be too concerned about a few for loops. That said, I'd probably do two things: use hash slices (see perldata) instead of all of the individual $data{key} = $_->key; statements, and pull the guts of the for ( @info ) loop into a subroutine (since you use it twice). For example (untested):
Note: I changed $r to $info->count to clean up the hash slice. Update: Corrected $count to $info->count. HTH, and congrats on getting it working. That's the first step. :-)
In Section
Seekers of Perl Wisdom
|
|