my $random_file = $names[rand(@names-1)];
That will always skip the last element of @names. It should be:
my $random_file = $names[ rand @names ];
In reply to Re^2: Opening random files then reading random lines from file.
by jwkrahn
in thread Opening random files then reading random lines from file.
by fame
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |