This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ blame
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blob
|
blame
(incremental) |
history
|
HEAD
perl 3.0 patch #9 (combined patch)
[perl5.git]
/
eg
/
rename
Commit
Line
Data
a687059c
LW
1
#!/usr/bin/perl
2
3
($op = shift) || die "Usage: rename perlexpr [filenames]\n";
4
if ($#ARGV < 0) {
5
@ARGV = <stdin>;
6
chop(@ARGV);
7
}
8
for (@ARGV) {
9
$was = $_;
10
eval $op;
11
die $@ if $@;
12
rename($was,$_) unless $was eq $_;
13
}