"C:\\windows\\file.txt" #### my $filename="C:\\windows\\file.txt" ; ## or "C:/windows/file.txt" open (my $fh, "<", $filename) or die "Could not open $filename: $!"; #### while (<$fh>){ # Process the contents of the record # which is stored in $_ } close $fh or warn "Could not close $filename:$!";