http://qs321.pair.com?node_id=763683


in reply to UU-decode unpack of empty string yields undefined value

I'm running Perl v5.10.0 on Linux and I get the exact same output. I would assume, in a string context, an empty string to remain an empty string and not to become an "undefined value". An empty string is valid unicode (or indeed should be valid in any and every encoding) after all. I too am curious about the reason for this "feature", as I do a lot of unicode handling in my code – I've never noticed this before...
  • Comment on Re: UU-decode unpack of empty string yields undefined value

Replies are listed 'Best First'.
Re^2: UU-decode unpack of empty string yields undefined value
by almut (Canon) on May 13, 2009 at 07:05 UTC
    ...as I do a lot of unicode handling in my code

    Just to avoid confusion:  uuencoding has nothing directly to do with Unicode.

    Note the difference between upper and lower case U. From pack:

    u A uuencoded string. U A Unicode character number. Encodes to UTF-8 inter +nally (or UTF-EBCDIC in EBCDIC platforms).