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");
}

1 comment:

  1. And sure enough, three years later, I needed this script again. Thank you, 2010 self.

    ReplyDelete