Help for this page

Select Code to Download


  1. or download this
    use constant DEFAULT_FILE => "/etc/filesystems";
    my $file = shift || DEFAULT_FILE; # e.g. to take file from command lin
    +e or use the default
    ...
      my ($file, $pattern) = @_;
      # your code here
    }
    
  2. or download this
    ...
    die "oh no, it's not there!" unless find_pattern($file, $pattern);
    ...
      my ($file, $pattern) = @_;
      return `grep $pattern $file`;
    }