Re: Converting codepages to UTF8
- From: "P" <szpara_ga@xxxxxxx>
- Date: 31 Mar 2006 11:10:33 -0800
Dr.Ruud wrote:
P schreef:
#!/usr/bin/perl
use warnings;
use strict;
I think you need this:
use Encode qw(cp437 cp850 cp852);
But those are just arguments to the decode() subroutine. They aren't
exported by Encode.pm so that gives errors.
or maybe
use Encode::Byte;
According to the documentation for Encode::Byte decode()
loads Encode::Byte implicitly.
but see also the remarks about PerlIO in `perldoc Encode`.
Those remarks only show of a way to do the encoding on-the-fly.
The result is exactly the same, though.
opendir(DIR, '.') or die "Can't open input directory: $!";
Alternative:
opendir my $dir, '.'
or die "Can't open input directory: $!";
my %files = map { $_ => 1 } grep { $_ !~ m/^\.\.?$/ } readdir(DIR);
Maybe:
my %files = map { $_ => 1 } grep { ! m/\A\.\.?\z/s } readdir $dir;
or:
my %files = map { $_ => 1 } grep -f, readdir $dir;
These tips don't address the issue, though.
Thanks anyway.
--
Best regards,
Angela Druss
.
- References:
- Converting codepages to UTF8
- From: P
- Re: Converting codepages to UTF8
- From: Dr.Ruud
- Re: Converting codepages to UTF8
- From: P
- Re: Converting codepages to UTF8
- From: Dr.Ruud
- Re: Converting codepages to UTF8
- From: P
- Re: Converting codepages to UTF8
- From: Dr.Ruud
- Converting codepages to UTF8
- Prev by Date: Re: exit status
- Next by Date: Re: Converting codepages to UTF8
- Previous by thread: Re: Converting codepages to UTF8
- Next by thread: Re: Converting codepages to UTF8
- Index(es):
Relevant Pages
|