Wednesday, March 10, 2010

Image shuffling script

I've written this Perl script twice now, so I might as well immortalize it somewhere where I'll be able to find it again.

This script randomizes the names of a folder full of JPGs. This is useful for showing a looping slideshow on the PS3 with a random order.


#!/usr/bin/perl
@files = <*>;
foreach $file (@files)
{
rename($file, rand() . ".jpg");
}