Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use File::Spec; use utf8; my $infile = File::Spec->catfile("C:/temp/", "foo.txt",); if (-e($infile)) { print ("I can see $infile\n"); # Works fine --> if (!(open my $in_fh, "<$infile")) { if (!(open my $in_fh, "<:encoding(utf8)", "$infile")) { my $message = __LINE__.": Cannot open $infile\n:$!:\n"; print ($message); } } else { print ("No in file $infile\n"); } print ("Hello\n");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: PAR will not play nice with opening encoding(utf8)
by lamprecht (Friar) on May 24, 2010 at 19:05 UTC | |
by Anonymous Monk on May 24, 2010 at 19:16 UTC | |
|
Re: PAR will not play nice with opening encoding(utf8)
by Anonymous Monk on May 25, 2010 at 08:33 UTC |