Here, the file name is input by the user as a command-line argument ($ARGV[0]).
D:\>chcp 1252 Active code page: 1252 D:\>dir acentó.dat /b acentó.dat D:\>perl test.pl acentó.dat Successfully opened file 'acentó.dat' D:\>type test.pl #!perl use strict; use warnings; my $fn = shift; if (open my $fh, '<', $fn) { print "Successfully opened file '$fn'\n"; close $fh; } else { print "Error opening file '$fn': $!\n"; } D:\>
In reply to Re^3: opening accented file names
by Jim
in thread opening accented file names
by memo.garciasir
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |