- or download this
#!/usr/bin/perl -w
use strict;
...
$_ = "123 456\n";
/^(\w+)\s+(\w+)$/;
print "<$1><$2>\n";
- or download this
<abc><def>
<abc><def>
<123><456>
- or download this
while (<DATA>) {
if (/^(\w+)\s+(\w+)$/) {
...
print "Line $. didn't match\n";
}
}