<?xml version="1.0" encoding="windows-1252"?>
<node id="303855" title="Re: Randomize lines with limited memory" created="2003-11-01 18:18:24" updated="2005-06-15 02:51:23">
<type id="11">
note</type>
<author id="182681">
sauoq</author>
<data>
<field name="doctext">
&lt;p&gt;Here's an implementation of the suggestion I made in my reply to [Corion]...
&lt;code&gt;
#!/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;
&lt;/code&gt;

Short and sweet. :-)
&lt;/p&gt;

&lt;div class="pmsig"&gt;&lt;div class="pmsig-182681"&gt;
&lt;pre&gt;
-sauoq
"My two cents aren't worth a dime.";
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
303841</field>
<field name="parent_node">
303841</field>
</data>
</node>
