Help for this page

Select Code to Download


  1. or download this
    {
        open(FILE, "sample.txt") or die "Can't open sample.txt\n";
    ...
    if($lines =~ /foo/) {
    print "A match was found\n"
    }
    
  2. or download this
    $lines =~ s/foo/bar/gms;