http://qs321.pair.com?node_id=11122063


in reply to mixed case with match

# But I'm not a golfer. use strict; use warnings; sub test { my ($m, $line) = (undef, 0); while ( <DATA> ) { $line++; last if (($m) = m/(perl)/i); } if ($m) { printf "There were %d lines until I found '%s'\n", $line, $m; } else { printf "I never found 'perl' in %d lines\n", $line; } } test test __END__ 1 2 3 This is peRl ok 1 2 3