in reply to Shuffle flat file

There is no shame in posting code (we were all Perl newbies once). We can't know what is wrong (and hence why it won't work) without seeing some code.

I don't understand what you mean by shuffling based on first field, a random shuffle is a random shuffle. Anyhow, here is some code to help you get started (the code for the shuffle is the same as in the docs (ie. perldoc -q random):

use strict; use warnings; my @array = <DATA>; fisher_yates_shuffle(\@array); print @array; sub fisher_yates_shuffle { my $deck = shift; # $deck is a reference to an ar my $i = @$deck; while ($i--) { my $j = int rand ($i+1); @$deck[$i,$j] = @$deck[$j,$i]; } } __DATA__ Entry1:Desc:Keyword1,Keyword2,Keyword3 Entry2:Desc:Keyword1,Keyword2,Keyword3 Entry3:Desc:Keyword1,Keyword2,Keyword3 Entry4:Desc:Keyword1,Keyword2,Keyword3 Entry5:Desc:Keyword1,Keyword2,Keyword3 Entry6:Desc:Keyword1,Keyword2,Keyword3 Entry7:Desc:Keyword1,Keyword2,Keyword3 Entry8:Desc:Keyword1,Keyword2,Keyword3 Entry9:Desc:Keyword1,Keyword2,Keyword3 Entry10:Desc:Keyword1,Keyword2,Keyword3
-enlil