use encoding in both scripts and modules

2002-05-06 Thread Tatsuhiko Miyagawa

panic happens while hacking with encoding pragma.

slasher:/home/miyagawa/tmp cat encoding-test.pl
use strict;
require 5.7.3;

use encoding 'euc-jp';
use EncBar;

my $bar = EncBar::foo;
print $bar;

slasher:/home/miyagawa/tmp cat EncBar.pm
package EncBar;
use encoding 'euc-jp';
sub foo { \xa4\xdb }

1;

slasher:/home/miyagawa/tmp bleadperl encoding-test.pl
\x{46c5} does not map to euc-jp.
panic: sv_setpvn called with negative strlen.



-- 
Tatsuhiko Miyagawa [EMAIL PROTECTED]



Re: use encoding in both scripts and modules

2002-05-06 Thread Dan Kogai

On Monday, May 6, 2002, at 05:16 , Tatsuhiko Miyagawa wrote:
 panic happens while hacking with encoding pragma.

It seems use encoding is still in effect after you 'use EncBar'.  
Simply commenting out 'use encoding 'euc-jp'' in encoding-test.pl makes 
the program work as expected.

Dan




Re: use encoding in both scripts and modules

2002-05-06 Thread Tatsuhiko Miyagawa

At Mon, 6 May 2002 18:57:11 +0900,
Dan Kogai wrote:

  panic happens while hacking with encoding pragma.
 
 It seems use encoding is still in effect after you 'use EncBar'.  
 Simply commenting out 'use encoding 'euc-jp'' in encoding-test.pl makes 
 the program work as expected.

yep, I know duplicate calls to use encoding ... is discouraged (as
written in docs). But is this panic thing as expected?


-- 
Tatsuhiko Miyagawa [EMAIL PROTECTED]