chomp( my $input = ); $regexp = qr/$input/; if $line =~ ?$regexp? ...