can you help explain the code below?I don't know why the "ref" and "scalar" functions here can be used to validate if it's ASCII or UTF8 encoding.
use constant ASCII => ref eval {
require Encode;
Encode::find_encoding('ascii');
};
use constant UTF8 => scalar eval {
Encode::encode_utf8( chr(182) ) eq pack( 'H*', 'C2B6' );
};
Thanks.
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/
