-#my $teshfile=$tesh_file;
-#$teshfile=~ s{\.[^.]+$}{};
-
-unless($tesh_file eq "(stdin)"){
- open TESH_FILE, $tesh_file or die "[Tesh/CRITICAL] Unable to open $tesh_file $!\n";
+my $infh; # The file descriptor from which we should read the teshfile
+if($tesh_file eq "(stdin)"){
+ $infh = *STDIN;
+} else {
+ open $infh, $tesh_file
+ or die "[Tesh/CRITICAL] Unable to open $tesh_file $!\n";