As for reading a random line from a file: If you're resigned to reading the whole file, this is a neat hack:
-- Chip Salzenberg, Free-Floating Agent of Chaoswhile (<FILE>) { $chosen_line = $_ if rand($.) < 1; }
In reply to Re: RandomFile
by chip
in thread RandomFile
by jettero
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |