Perl 源程序 use strict; use warnings;
while ( 7.2 Perl 源程序 use strict; use warnings; while ( 7.3 Perl 源程序 use strict; use warnings; while ( } } print $_; 运行结果 7.4 Perl 源程序 use strict; use warnings; while ( 运行结果 7.5 Perl 源程序 use strict; use warnings; while ( 运行结果 7.6 Perl 源程序 use strict; use warnings; while ( 运行结果 8.1 Perl 源程序 use strict; use warnings; while (<>) { chomp; if (/match/) { print \"Matched: | $`<$&>$' |\\n\"; }else { print \"No match: | $_ |\\n\"; } } 运行结果 8.2 Perl 源程序 use strict; use warnings; while (<>) { chomp; if (/a\\b/) { print \"Matched: | $`<$&>$' |\\n\"; } }else { print \"No match: | $_ |\\n\"; } 运行结果 8.3 Perl 源程序 use strict; use warnings; while (<>) { chomp; if (/(\\b\\w*a\\b)/) { print \"Matched: | $`<$&>$' |\\n\"; print \"\\$1 contains '$1'\\n\"; }else { print \"No match: | $_ |\\n\"; } } 运行结果 8.4 Perl 源程序 use strict; use warnings; use 5.010; while ( 运行结果 8.5 Perl 源程序 use strict; use warnings; while (<>) { chomp; if (m! (\\b\\w*a\\b) (.{0,5}) !xs) { print \"Matched: | $`<$&>$' |\\n\"; }else { print \"No match: | $_ |\\n\"; } } 运行结果 8.6 Perl 源程序 use strict; use warnings; while (<>) { chomp; if (/\\s+$/) { print \"$_#\\n\"; } } 运行结果 因篇幅问题不能全部显示,请点此查看更多更全内容