#!/usr/bin/perl use strict; use warnings; # 3 argument form of open using a lexical variable is considered better practice # see perldoc -f open open my $file, '<', $ARGV[0] or die "Can't open $ARGV[0] for reading: $!\n"; while (my $line = <$file>) { print $line; chomp($line); #if you need to # any other processing.... }