Very nice set of examples!  Just one nit to pick...

Timothy Johnson <[EMAIL PROTECTED]> writes:

> #For our next trick, lets create a new object for simplicity, and add
> #a value to our new key.
>  
> my $BeginnerKey = $Registry->{'HKEY_CURRENT_USER/Software/Perl Beginners/'};
> $BeginnerKey->{'TIMTOWTDI'} = "There Is More Than One Way To Do It";

Strictly speaking, the expression $BeginnerKey->{'TIMTOWTDI'} is
ambiguous; it could be referring to either a subkey or a value,
because those namespaces are distinct.  TieRegistry will generally do
the right thing, guessing what you mean from context or trying to look
up both.  But it is generally faster and less error-prone to be
explicit:

  my $BeginnerKey = $Registry->{'HKEY_CURRENT_USER/Software/Perl Beginners/'};
  $BeginnerKey->{'/TIMTOWTDI'} = "There Is More Than One Way To Do It";

Or, written as one statement:

  $Registry->{'HKEY_CURRENT_USER/Software/Perl Beginners//TIMTOWTDI'}
    = "There Is More Than One Way To Do It";

It looks weird, but the rule is actually pretty simple: If the name
ends in a slash, it is a subkey name; if it starts with a slash, it is
a value name.  So to unambiguously refer to the value under a subkey,
you always end up with a doubled slash.

 - Pat
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to