Ken Williams wrote:
On Mar 2, 2005, at 5:53 PM, Linda W wrote:
I'm not sure what perl does with invalid
character data in a variable when you try to manipulate
it by appending it to another value.
There's no such thing as invalid character data in Perl strings. Perl
strings can contain arbitrary binary data.
-Ken
----
Was just told by another tester that the attached reg code can't
be enumerated by the older Win32::Registry code either. Her test:
---
> use Win32::Registry;
>
> my $key = $HKCU->Open('_ATEST_\.Default');
>
> my @subkeys = $key->GetKeys();
>
> foreach my $sub (@subkeys) {
> print "Subkey: $sub\n";
> print "\tvalue: " . $key->QueryValue( $sub) . "\n";
> }
>
> should print the subkeys of HKEY_CURRENT_USER\_ATEST_\.Default and
> their values, it prints:
>
> Subkey: Curren0?
> value: myvalue1
> Subkey: current0?
> value: myvalue2
> Subkey: current0?
> value: myvalue2
> As you can see somehow the name of the second and third key got
> converted to the same string. I tried to add
> $h{$sub}++
> into the foreach{} and sure enough the Data::Dumper dump of the %h
> was:
>
> $VAR1 = {
> 'current0?' => 2,
> 'Curren0?' => 1
> };
She's using ActivePerl v5.8.0 build 805 on a Win2ksp4 server.
I'm glad to see I'm not the only one who can reproduce this problem.
It _appears_ that perl is may be doing some string conversion that is
taking two different binary strings and converting them into the same
internal representation.
The attach ".reg" file will create a test-key that can easily be deleted
in regedit under "Cuser\_ATEST_".
ÿþW i n d o w s R e g i s t r y E d i t o r V e r s i o n 5 . 0 0
[ H K E Y _ C U R R E N T _ U S E R \ _ A T E S T _ \ . D e f a u l t \ C u r r e n 0 ]
[EMAIL PROTECTED]"