1. work on $_ by default
i.e. it will work on $_ if we don't give any vars;
while (<>)
{
print if m/leo/;
print s/leo/LEO/; # print number of matches found and replaced
print $_;
}
[root@sxvvr10 lzc]# ./sysadm.pl
leoisOK
leoisOK
1LEOisOK
2. binding operators
=~: match is true
!~ : no match is true
3. modifiers
/i --- case insensitive
/g --- global matches
muti-line modifiers:
Mode Specified with ^ matches... $ matches... Dot matches newline
default neither /s nor /m start of string end of string No
single-line