#!/usr/bin/perl use strict; use warnings; open( my $fh, '<', 'test.txt' ) or die $!; while( my $line = <$fh> ){ print $line; } close $fh;