projects
/
p5sagit/p5-mst-13.2.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
perl 3.0 patch #22 patch #19, continued
[p5sagit/p5-mst-13.2.git]
/
eg
/
rename
1
#!/usr/bin/perl
2
3
($op = shift) || die "Usage: rename perlexpr [filenames]\n";
4
if (!@ARGV) {
5
if (-t) {
6
@ARGV = <*>;
7
}
8
else {
9
@ARGV = <STDIN>;
10
chop(@ARGV);
11
}
12
}
13
for (@ARGV) {
14
$was = $_;
15
eval $op;
16
die $@ if $@;
17
rename($was,$_) unless $was eq $_;
18
}