Help for this page

Select Code to Download


  1. or download this
    # Use a regex object so it's compiled only once
    $exp = qr|^DMSC0022\s+\S+\s+(\w+)$|;
    ...
        # to generate. This is still silly.
        eval "print \"$str\"";
      }
    
  2. or download this
    $exp = qr/\w+$/;
    $str = "Logfile_Connection_Lost Hostname:";
    ...
    
    ($hostname) = $input =~ m/$exp/g;
    print "$str$hostname" if defined $hostname;