in reply to Counting the Times Two Unknown Values Appear Together

There's nothing stopping you from using a regular expression. As long as you escape the meta characters, $variables will work just in a regex.
my $count = 0; while (<FILE>){ $count++ if /\Q$src/ && /\Q$sport/; } print "Both found a total of $count times\n";
- Miller

Update: (03:58 UTC) Ahh, misunderstand "beforehand". I second that kyle's reply is the way to go.