We don't bite newbies here... much | |
PerlMonks |
Re: Tagline Rotatorby Daddio (Chaplain) |
on May 29, 2001 at 07:46 UTC ( [id://83830]=note: print w/replies, xml ) | Need Help?? |
cajun, I think this is a great script. It's simple and straightforward. I would like to point out a couple of things that I think would help. First, I might recommend putting the open(OUTFILE,...) and close OUTFILE into the same else section as the print OUTFILE @body. There's no sense opening and closing a file if you don't need to in debug mode (and it will erase whatever is there if you are in debug mode - no sense doing that, either). Second, and more importantly, the sprintf("%.0f", ($rand) code may return a 0. To counter that, I would recommend these two changes: One, change my $rand=$rand($.);to
Two, change push (@body, qq( $hash{sprintf("%.0f", ($rand))}));to push (@body, qq( $hash{$rand}));Hope this makes sense (it's been a long day :)! D a d d i o
In Section
Code Catacombs
|
|