#!/usr/bin/perl -w
# rename - Larry's filename fixer
# Aufruf Beispiel:   perl ./ren.pl 's/jpg\.ppm\.jpeg$/jpg/'  *.jpeg

$op = shift or die "Usage: rename expr [files]\n";
chomp(@ARGV = <STDIN>) unless @ARGV;
for (@ARGV) {
    $was = $_;
    eval $op;
    die $@ if $@;
    rename($was,$_) unless $was eq $_;
}