use strict; use warnings; use Data::Dumper; $Data::Dumper::Terse=1; sub foo { print "foo: bad args: ", Dumper \@_ if @_ != 2 || $_[0] !~ /^[tf]/ || $_[1] !~ /statement/; my ($tf, $statement) = @_; if ($tf =~ /^t/) { # Line 12 print "true: $statement\n"; } else { print "false: $statement\n" } } for my $statement ("the following statement is true", "the preceding statement is false") { $statement =~ /\b(t|f|true|false)\b/ or next; foo($1, $statement); }