#!/usr/bin/perl
# convert gifs to xpms
# run this in a directory to  convert 
# all the files. It also leaves the gifs unharmed
$dir = ".";
$dir = $ARGV[0] if @ARGV;
opendir DIRH , $dir;
@gifs = grep /gif|GIF/, readdir DIRH;
closedir DIRH;
print "Found " .scalar(@gifs) . " in $dir\n";
foreach $one (@gifs) {
	$two = $one;
	$two =~ s/gif/xpm/;
	$two =~ s/GIF/xpm/;
	print "cat $one | giftopnm |ppmtoxpm > $two\n";
	system "cat $one | giftopnm | ppmtoxpm > $two";
}

