Au contraire, using perl 5.6.1:
perl -MClone=clone -e'$a=\( chr 256); $b=clone $a; print ord $$b,"\n"'
256
ray@baker:/tmp$ perl -MClone=clone -e'$a=[ chr 256]; $b=clone $a; print
ord $b->[0],"\n"'
256
Only one test appears to fail:
perl -MClone=clone -e'$a={ chr 256 => 1 }; $b=clone $a; print ord((keys
%$b)[0]),"\n"'
196
however, note that
perl -e'$a={ chr 256 => 1 }; print ord((keys %$a)[0]),"\n"'
196
gives the same result. The problem only seems to relate to hash keys and
it was easy enought to fix: I've uploaded a new version, Clone-0.15 that
that fixes this for perl 5.8.0. I use the test case
ord( (keys(%$a))[0] ) == ord( (keys(%$b))[0] ) ? ok : not_ok;
rather than
256 == ord( (keys(%$b))[0]) ? ok : not_ok;
so the test will not fail in 5.6.1 and below.
Sincerely,
Ray.
[guest - Thu Mar 20 09:43:15 2003]:
Show quoted text> It appears that Clone does not support Unicode structures correctly :-
>
> perl5.8.0-32-g -MClone=clone -le '%a=(chr 256 =>1);$c=clone \%a;
> print ord foreach keys %$c'
> 196
>
> as oposed to
>
> perl5.8.0-32-g -MStorable=dclone -le '%a=(chr 256 =>1);$c=dclone \%a;
> print ord foreach keys %$c'
> 256
>
> This was found when investigating
>
http://rt.cpan.org/NoAuth/Bug.html?id=2252
>
> However perl 5.6.1 for both Storable and Clone return the same wrong
> answer of 196 but this was fixed for Storable in perl 5.8.0
>
> Thanks
>
> Paddy