#!/usr/bin/perl use strict; use warnings; use FindBin qw($Bin); my $filename='./test.txt'; my $real_filename="$Bin/$filename"; open(my $fh, '<', $real_filename) || die("ERROR open $real_filename ($!)\n"); while(my $line=<$fh>) { print $line; } close($fh);