in reply to Randomize lines with limited memory
Here's an implementation of the suggestion I made in my reply to Corion...
Short and sweet. :-)#!/usr/bin/perl -w use strict; use Tie::File; use List::Util qw( shuffle ); tie my @file, 'Tie::File', $ARGV[0] or die "$ARGV[0]: $!"; print $file[$_], "\n" for shuffle 0 .. $#file;
-sauoq "My two cents aren't worth a dime.";
|
---|
In Section
Seekers of Perl Wisdom