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
my $rand = 0; $rand = int rand($.) until $rand != 0;
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 reply to Re: Tagline Rotator
by Daddio
in thread Tagline Rotator
by cajun
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |