my $char = chr oct 14; while (my $line = ){ if ($line =~ m/\Q$char\E/){ # do whatever you want } }