my @test_data = ( qw/bananas apples oranges/, 'Thu Oct 18 21:26:36 2007: Time for all triggers in report period (60s): 1.330981s', 'Thu Oct 18 21:27:36 2007: Time for all triggers in report period (120s): 1.457271s', 'Thu Oct 18 21:28:36 2007: Time for all triggers in report period (300s): 1.340150s' ); for ( @test_data ) { if ( m/\((\d+)s\)/ && $1 != 60 ) { print "$_\n"; exit $1 } }