At 1:18 PM +0100 5/21/02, Nick Ing-Simmons wrote:
>Good - that decouples the whole thing from previous runs etc. etc.
>Why the FileHandle and warnings bits - are they necessary to see the problem?
You're right. I stopped chopping a few lines too early. The
following also exhibits the problem:
use strict;
use Encode (":all");
open FH, '<:encoding(euc-kr)', 'ksc5601.enc' or die "ksc5601.enc : $!";
my $dtext = join('' => <FH>);
close FH;
>1. Can you grep CPP'ed perlio.c for "right" VMS hackery for ungetc() ?
Here's a chunk from the listing file where the lines marked E show expanded macros:
1 59411 STDCHAR *buf = ((STDCHAR *) vbuf) + count - 1;
E char
E char
1 59412 SSize_t unread = 0;
E int
2 59413 while (count > 0) {
2 59414 int ch = *buf-- & 0xff;
2 59415 if (PerlSIO_ungetc(ch, s) != ch)
E ((ch) == (-1) ? (-1) : ((*( s) && !((*( s))->_flag & 0x04) &&
((*( s))->_ptr > (*( s))->_base)) ? ((*( s))->_cn
E t++, *(--(*( s))->_ptr) = (ch)) : decc$ungetc(ch, s)))
2 59416 break;
2 59417 unread++;
2 59418 count--;
1 59419 }
1 59420 return unread;
1 59421 }
59422
>2. Can you try using :perlio layer rather than :stdio layer and
> see if that helps
> on UNIX that would be
> PERLIO=perlio perl vms_problem.t
Good call. That dodges the problem:
$ define PERLIO "perlio"
$ perl vms_problem.t
$
--
____________________________________________
Craig A. Berry
mailto:[EMAIL PROTECTED]
"Literary critics usually know what they're
talking about. Even if they're wrong."
-- Perl creator Larry Wall