#!/usr/bin/perl
#rename files, straight from the Perl Cookbook

use strict;

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

__END__