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: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to