[oracle@jhoa 7]$ cat 5.pl
if ( $#ARGV < 0 ){
print "请输入一个日期参数
";
exit(-1);
}
$var = $ARGV[0];
if ($var =~/xy/) ##匹配xy字符
{print "ok
"}
else
{print "no
"}
[oracle@jhoa 7]$ perl 5.pl xy
ok
[oracle@jhoa 7]$ perl 5.pl xyzz
ok
[oracle@jhoa 7]$ perl 5.pl yyy
no