Help for this page

Select Code to Download


  1. or download this
    
    open SMALL, '<small file' or die "Couldn't open smalllfile; $!\n";
    my @find = map { $_ =~ s/^\d{2}:\d{2}(.*)$/$1/; } <SMALL>;
    close SMALL or warn "Couldn't close smallfile; $!\n";
    
  2. or download this
    
    open BIG, '<bigfile' or die "Couldn't open bigfile; $!\n";
    ...
    
    print "Didn't find the contents of smallfile in bigfile\n" unless $mat
    +ched;
    
  3. or download this
    my @excluded = qw( a did encountered process );    # tailor as appropr
    +iate
    for my $line (@lines) {
    ...
        $line = qr"@word"o;
    }
    
  4. or download this
        $match=0 and next unless $_ eq @find[match++];
    
  5. or download this
        $match=0 and next unless $_ =~ @find[match++];
    
  6. or download this
        (?i-xsm:abc.*?problem)
        (?i-xsm:abc.*?restart)
    
  7. or download this
    for my $line (@lines) {
        # break the line into an array of words minus exclusions
    ...
        # replace each line with a multi-matching compiled regex
        $line = qr"\b@a\b"oi;
    }
    
  8. or download this
        my $n = () = $_ =~ m/@find[match++]/g;
        $match=0 and next unless $n > $than_some_predetermined_ number;