$$varname dereferences $varname in a scalar context. So in your example
below, $ref is an array reference. So, @$ref is the actual array and
$$ref[0] is the first element of @$ref, etc...
To create a reference, you use the backslash operator. for example
$x = 10;
$rx = \$x;
$$rx = 20; # This changes x.
print $x; # prints 20.
Good Luck!
Tanton
-----Original Message-----
From: Morgan Norell
To: [EMAIL PROTECTED]
Sent: 8/24/2001 7:50 AM
Subject: $$ What does it mean?
Can someone tell my why there are two $$ in the row below the for
statement, is there any special
meaning or ?
while (my $ref = $std->fetchrow_arrayref()) {
my %resultrow;
for (my $i = 0; $i < $numFields; $i++) {
$resultrow{$$names[$i]} = $$ref[$i];
}
...print data...
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]