in reply to Regular expression only matches a single character

I'm guessing you might be parsing the file name instead of the file. Try

while (my $line = <STDIN>) { print "Line: $line"; if ($line =~ /te/) { print "Match !\n"; } }

Then you should read File Input and Output