#!/usr/bin/perl -w use File::Grep qw( fgrep fmap fdo ); use Test::More tests=>11; my @files = qw( t/test.txt t/test2.txt ); # Void context: if ( fgrep { /Bob/ } @files ) { pass "Void context"; } else { fail "Void context"; } if ( fgrep { /Steve/ } @files ) { fail "Void context"; } else { pass "Void context"; } my $count = fgrep { /Bob/ } @files; is( $count, 5, "Scalar context" ); my @matches = fgrep { /Bob/ } @files; is( $matches[0]->{ count }, 5, "Hash context" ); is( $matches[1]->{ count }, 0, "Hash context" ); @matches = fgrep { /\WBob\W/ } @files; is( $matches[0]->{ count }, 4, "Hash context" ); my @lced = fmap { chomp; lc; } @files; is( "--$lced[4]--", "--by this test. if there are--", "Mapping" ); open FILE1, "