07/04/11 10:40:03
>>235
perlrun(1)の-iオプションの説明のとこに例があるだろ。よく嫁。
From the shell, saying
$ perl -p -i.orig -e "s/foo/bar/; ... "
is the same as using the program:
#!/usr/bin/perl -pi.orig
s/foo/bar/;
which is equivalent to
#!/usr/bin/perl
$extension = '.orig';
LINE: while (<>) {
if ($ARGV ne $oldargv) {
(改行大杉でおこられるので以下略)