"Lee Clemmer" <[EMAIL PROTECTED]> writes:

>       $retval = $key->SetValue("TurfTable", @junklist, "REG_MULTI_SZ"

Executive summary: Try \@junklist instead.

> I JUST tried this with the syntax shown in the example
> ("valuename",["foo.com","bar.com", "bax.com"],"REG_MULTI_SZ")
> What is the difference between my named array and an anonymous one?! 

Perl arrays have "splicing semantics", which are very useful.  But
they are definitely confusing if you are accustomed to other
languages.  (The closest thing in C is probably varargs, which is not
very close.  Even Lisp requires you to use things with names like
"quasiquote" and "unquote-splicing" and "eval" and "apply" to get
similar semantics.)

In short, this code:

  my @foo = (1, 2, 3);
  bar (@foo);

...does the same thing as this code:

  bar (1, 2, 3);

Both call "bar" with three arguments: the numbers 1, 2, and 3.

Contrast with this:

  my @foo = (1, 2, 3);
  bar (\@foo);

...which is the same as:

  bar ([1, 2, 3]);

These both call "bar" with one argument, a reference to an array
containing the numbers 1, 2, and 3.

The square brackets create a reference to an (anonymous) array.  To
obtain a reference to a named array, you put a backslash before the
name, like so:

  $retval = $key->SetValue("TurfTable", \@junklist, "REG_MULTI_SZ");

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

Reply via email to