Zsdc wrote:
You're right, in every case the real counting is done by the CORE::length, which only needs a little hint in $^H. The bytes::length subroutine is actually just:
{ BEGIN { $^H |= 8 } CORE::length $_[0] }
so you don't even need to use the bytes pragma at all. TMTOWTDI I guess. (Of course messing with $^H is not exactly what I call elegant, but still it's funny to write things like: use strict; BEGIN{$^H^=1538})
i think you cite perldoc perlvar incorrectly to assume 1538 is the correct bits for the bytes pragma:
$^H WARNING: This variable is strictly for internal use only. Its availability, behavior, and contents are subject to change without notice.
I didn't cite perlvar manpage at all, nor have I ever assumed 1538 had anything to do with bytes pragma.
this might break your code in future version of Perl.
Of course it might, like using any other undocumented interpreter's internal state interface. The behavior of $^H has been rather stable for years and I wouldn't count on it changing before Perl 6, still "Of course messing with $^H is not exactly what I call elegant" was kind of an understatment, to say the very least. Actually, it was meant to be funny.
-- ZSDC Perl and Systems Security Consulting
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]