Simon Cozens <simon@cozens.net> writes: >On Sat, Dec 30, 2000 at 12:14:44AM -0600, Jarkko Hietaniemi wrote: >[unicode::distinct] >> > Now any string which is SvUTF_off is equal to another string which >> > is SvUTF_on. `eq' can't distingush them. I don't see why eq should be able to tell them apart. If you want to stare into the guts you should _need_ to use Encode::is_utf8 or some other scalpel. >> >This pragma forces all >> > SvUTF_on string differ to any SvUTF_off string. >> >> Ummmm. Introducing new pragmas should be considered carefully. >> Can you give an example of how to use this pragma? What problem >> does it solve? > >Just one second! What's the difference between: > > $a = v50.400; chop $a; > $b = chr(50); > > print "Two chr(50)s are the same, no suprise" if $a eq $b > > { > use unicode::distinct; > print "Shouldn't be the same now" if $a eq $b; > } And how exactly are they not the same ? - the fact that UTF8 flag is on on one? Who says that chop may not downgrade? Who says that chr(50) may not upgrade on comparison on EBCDIC machine? And what about (the more problematic case): $a = v128.400; chop $a; $b = chr(128); > >and > > { > use bytes; > print "Shouldn't be the same now" if $a eq $b; > } bytes will show them equal for chr(50) 'cos it does not change under UTF-8 encoding. > >Seems to me the whole idea is what the bytes pragma is for. -- Nick Ing-SimmonsThread Previous | Thread Next