perl -e ' use P;
my $filelist="C:\Users\cign\Desktop\printFile.txt";
P "opening file: %s", $filelist;
'
opening file: C:SERS GNDESKTOPPRINTFILE.TXT
####
perl -we 'use strict; use P;
my $filelist="C:\Users\cign\Desktop\printFile.txt";
P "opening file: %s", $filelist;'
Unrecognized escape \D passed through at -e line 2.
Unrecognized escape \p passed through at -e line 2.
opening file: C:SERS GNDESKTOPPRINTFILE.TXT
####
perl -we 'use strict; use P;
my $filelist=q{C:\Users\cign\Desktop\printFile.txt};
P "opening file: %s", $filelist;'
opening file: C:\Users\cign\Desktop\printFile.txt
##
#alternate ways
##
> perl -we 'use strict; use P;
my $filelist='\''C:\Users\cign\Desktop\printFile.txt'\'';
P "opening file: %s", $filelist;'
opening file: C:\Users\cign\Desktop\printFile.txt
##
> perl -we 'use strict; use P;
my $filelist="C:\\Users\\cign\\Desktop\\printFile.txt";
P "opening file: %s", $filelist;'
opening file: C:\Users\cign\Desktop\printFile.txt
###
## my favorite (in a file)...
#! perl/bin/perl.exe
use strict; use P;
my $filelist="C:/Users/../tmp/../Perl64/printFile.txt";
P "opening file: %s", $filelist;
open (test, ">", $filelist) or die "didn't work";
print test "Hello World!\n";
close test;
C:\Perl64>perl test.pl
opening file: C:/Users/../tmp/../Perl64/printFile.txt
C:\Perl64>type printFile.txt
Hello World!