On Sep 25, Brett W. McCoy said:

>As an example:
>
>symbolic reference
>
>my $var = 12;
>
>my $varref = "var"; #point to the variable named $var

Except that $$varref in this case will point to a package variable named
$var, and not the $var you've defined here -- symbolic references use the
symbol table, and my() variables are not stored there.

>a hard reference (or just reference, since usualyl when people say
>reference they mean hard reference):
>
>my $var = 12;
>my $varref = \$var; #point to the value in $var

Here, $$varref will access the $var you've defined, and return 12.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to