#! perl -w
$/ =
"/n";
#print ($0 =~ /([^]*?)$/ ); this is a comment
$foo =
"word1 is2 the remain ...";
(
$f1,
$f2,
$etc) =
split(
' ',
$foo,
3);
print $f1;
print $f2;
print $etc;
#do the same operation
(
$a1,
$a2,
$a3) = (
$foo =~
/^/s*(/S+)/s+(/S+)/s*(.*)/);
print $a1;
print $a2;
print $a3;
转载请注明原文地址: https://ibbs.8miu.com/read-2281.html