#!/usr/bin/perl use strict; use warnings; use diagnostics; # this will help you understand the error messages better. my $file = "C:/path/to/some/file.txt"; open FILE, "<$file" or die "Can't read $file perl says error is $!\n"; while( my $line = ) { chomp $line; print "Got: $line\n"; } close FILE;