in reply to oct and vec
I can't think of any time where the two would be different when $foo contains a string of octets, but the equality is not always true if $foo contains a string of chars.
>perl -MHTML::Entities -le"$foo=decode_entities('♥'); print for + vec($foo,0,8), ord($foo)" 226 9829
vec($f,0,8) looks at the first octet of the internal representation of the string, whereas ord looks at the first character of the string.
|
|---|