in reply to Re^2: UU-decode unpack of empty string yields undefined value
in thread UU-decode unpack of empty string yields undefined value

Are you saying by this that the UU-encoding standard specifies no way to encode an empty string, i.e., that an empty string is, literally, 'undefined' in the standard?

Not quite. All I was trying to say is that while Perl variables internally have meta information to tell apart undef from empty, the uuencoding format doesn't have any such provision.  I.e. an empty string encodes to an empty string (nothing, zero bytes), and as it isn't really specified how to encode an undefined value, the nearest approximation would be to also encode it as nothing (zero encoded chars/bytes).

Now, when you're faced with having to decode that nothing, you cannot tell whether it has been generated by an empty string, or undef. So you just have to make some choice... and it's kind of arbitrary whether you consider decoding nothing into undef or the empty string as more appropriate.

  • Comment on Re^3: UU-decode unpack of empty string yields undefined value