- or download this
$ perl -Mstrict -Mwarnings -le 'print "C:\windows\file.txt"'
Unrecognized escape \w passed through at -e line 1.
C:windows
ile.txt
- or download this
$ perl -Mstrict -le 'print "C:\windows\file.txt"'
C:windows
ile.txt
- or download this
$ perl -Mstrict -Mwarnings -le 'print "C:\\windows\\file.txt"'
C:\windows\file.txt
- or download this
$ perl -Mstrict -Mwarnings -le 'print q{C:\windows\file.txt}'
C:\windows\file.txt
- or download this
$ perl -Mstrict -Mwarnings -le 'print qq{C:\windows\file.txt}'
Unrecognized escape \w passed through at -e line 1.
C:windows
ile.txt
- or download this
$ perl -Mstrict -Mwarnings -e 'my $PATH = q{not_a_file}; open fh $PATH
+'
Can't locate object method "fh" via package "not_a_file" (perhaps you
+forgot to load "not_a_file"?) at -e line 1.
- or download this
open my $fh, '<', $path or die "Can't open $path: $!";
- or download this
# Uncomment ONLY ONE of these:
#my $path = 'C:\windows\path\to\filename';
...
# Now open your chosen file for reading:
open my $fh, '<', $path or die "Can't open $path: $!";