in reply to problem with Unicode::UCD

Well, the only thing that I can see is that you have 'declared 'your other variables through the use of 'my', as you do in your test of the charblock function.

In your main example, I do not see where you have declared $c. Of course, if you are using strict, this would cause a parse error. Maybe declare $c, set it to some default, like the empty string, and try it out.

This suggestion is probably a non starter, but it is the first thing that sprang to mind for me.

"Never take yourself too seriously, because everyone knows that fat birds dont fly" -FLC

Replies are listed 'Best First'.
Re^2: problem with Unicode::UCD
by rubenstein (Novice) on May 19, 2005 at 23:51 UTC
    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.
      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.