use warnings; use strict; my @songs = split /\n/, <<"Song_list"; /home/ben/Music/Sea Shanties/Haul Away Joe Evans And Doherty.mp3 /home/ben/Music/NiN/I'm Afrraid Of Americans.mp3 /home/ben/Music/Sea Shanties/A-Rovin' Richard Burbank.mp3 /home/ben/Music/Elton John - Live in Australia/Madman Across The Water.mp3 /home/ben/Music/Great Big Sea - Road Rage/Hangin' Johnny.mp3 ... ... ... Song_list; # Test loop - print 2x as many entries as there are songs for (0 .. @songs * 2){ my $pick; rand($_ + 1) < 1 && ($pick = $_) for 0 .. $#songs - int($#songs/2); print "$songs[$pick]\n"; push @songs, splice @songs, $pick, 1; }