in reply to Displaying utf8 text in perl -d

I've had a lot of nasty trouble using "perl -d" with scripts that need to handle utf8 text. I'll need to try the binmode $DB::OUT, ':utf8' trick to see if that helps.

What I have tried, which has usually had some positive effect on interactive debugging sessions, is to manually repeat the binmode ..., ":utf8" for both STDOUT and STDERR as commands to the debugger after it starts, and then always use "print $var" or ("print Dumper $ref" when using Data::Dumper) rather than just the "p" debugger command; that way, I don't get "Wide character in print" warnings.

Other problems I've had involve trying to step past regex operations on wide-character strings, and suddenly getting an "out-of-memory" crash (sometimes phrased as "ridiculous memory request" or words to that effect).

There seems to be some sort of bad interaction between the debugger and the wide-character handling in regexes; I've stumbled over it on macosx/perl 5.8.6, and on freebsd/perl 5.8.7/8 (there seems to be somewhat less trouble with 5.8.8, but I've still seen some problems there).

I really should try to put together a simple case that demonstrates the trouble, and report a bug...

Replies are listed 'Best First'.
Re^2: Displaying utf8 text in perl -d
by BrowserUk (Patriarch) on Sep 16, 2007 at 05:52 UTC
    I really should try to put together a simple case that demonstrates the trouble, and report a bug...

    For any monk who regularly, or even intermittently, uses a Win32 (native) build of Perl, your posts (at least 50% of them) should be required reading.

    I've never used anything but a win32 version, AS or home-built, version of Perl, and I have learnt more from your posts that any single other source.,


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.