leriksen has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use IO::File; use PerlIO; use Data::Dumper; my $fname = 'big.txt'; my $fh = IO::File->new($fname, "<:utf8") or die "cannot open $fname :: $!"; STDERR->print(Dumper([PerlIO::get_layers($fh)])); $fh->close();
$VAR1 = [ 'unix', 'perlio', 'utf8' ];
#!/usr/bin/perl -w use strict; use IO::File; use PerlIO; use Data::Dumper; my $fname = 'big.txt'; my $fh = IO::File->new($fname, O_RDONLY, ":utf8") or die "cannot open $fname :: $!"; STDERR->print(Dumper([PerlIO::get_layers($fh)])); $fh->close();
+++++++++++++++++
#!/usr/bin/perl
use warnings;use strict;use brain;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Getting IO::File, PerlIO Layers and POSIX to play together
by gellyfish (Monsignor) on Jul 07, 2004 at 12:08 UTC | |
by ambrus (Abbot) on Jul 08, 2004 at 00:23 UTC |