perl 3.0 patch #11 patch #9, continued
[p5sagit/p5-mst-13.2.git] / eg / rename
CommitLineData
a687059c 1#!/usr/bin/perl
2
3($op = shift) || die "Usage: rename perlexpr [filenames]\n";
4if ($#ARGV < 0) {
5 @ARGV = <stdin>;
6 chop(@ARGV);
7}
8for (@ARGV) {
9 $was = $_;
10 eval $op;
11 die $@ if $@;
12 rename($was,$_) unless $was eq $_;
13}