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_".
ÿþWindows Registry Editor Version 5.00



[HKEY_CURRENT_USER\_ATEST_\.Default\Curren0]

[EMAIL PROTECTED]"myvalue1"



[HKEY_CURRENT_USER\_ATEST_\.Default\current0?]

[EMAIL PROTECTED]"myvalue2"



[HKEY_CURRENT_USER\_ATEST_\.Default\current0¼€]

[EMAIL PROTECTED]"myvalue3"



[HKEY_CURRENT_USER\_ATEST_\AppGPFault\Curren0]

[EMAIL PROTECTED]"myvalue4"



[HKEY_CURRENT_USER\_ATEST_\AppGPFault\current0¼€]

[EMAIL PROTECTED]"myvalue5"



Reply via email to