#! /usr/perl/bin
use warnings;
use strict;
my $in=$ARGV[0];
$out=$in;
$out=~s/(\.w+)?$/\.out/;
print $out;
open LOG1,"<$in";
open LOG2,">$out";
=============
$out=~s/(\.w+)?$/\.out/;
1.这一行为什么必须加上?才能匹配并且替换成.out,$out=~s/(\.w+)$/\.out/; 为什么不能替换
2.\.out--替换成的内容为什么不加反斜杠也可以呢?