Help for this page

Select Code to Download


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