in reply to Getting a funny newline that was not there before
I happened to notice this curious snippet in your code:
Are you intentionally using the intermediate hash to reorder your @files array? I can find no other usage of your %hash variable in your code. If so, List::Util::shuffle will provide more randomness from run-to-run, and it would also make the intent of your code more evident:my %hash = map { $_ => 1 } @files; @files = keys %hash;
use List::Util qw(shuffle); @files = shuffle(@files);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Getting a funny newline that was not there before ([OT] shuffle)
by BrowserUk (Patriarch) on Mar 26, 2010 at 00:54 UTC | |
by toolic (Bishop) on Mar 26, 2010 at 01:13 UTC | |
|
Re^2: Getting a funny newline that was not there before ([OT] shuffle)
by MikeDexter (Sexton) on Mar 30, 2010 at 20:42 UTC |