in reply to Re: problem with Unicode::UCD
in thread problem with Unicode::UCD

It turns out that the problem was the slurping.
When I added
$/ = "\n";
after
my $string = <INPUT>;
things worked fine. I had done my test use of the function before slurping up the actual data. Annoying.

Replies are listed 'Best First'.
Re^3: problem with Unicode::UCD
by graff (Chancellor) on May 20, 2005 at 02:37 UTC
    I haven't looked at the source for Unicode::UCD, but I'm guessing that it's probably doing some file input somewhere. (Not an unreasonable thing.)

    That's one good reason why slurp mode should really be done like this, especially in code that uses modules, to make sure that undef'ing $/ is localized to just the code block where this is needed:

    my $filedata; open( IN, '<', $filename ) or die "whatever. $!"; { local $/; $filedata = <IN>; } close IN;
      Thanks! That's what I'll do now.