| Bob Showalter 2004-07-23, 8:56 am |
| Prasanna Kothari wrote:
> Hi,
> What's difference between these 2 statements:
> $uid = *REAL_USER_ID --> Getting a wrong value
> and
> $uid = $REAL_USER_ID --> Getting the correct value.
>
> AFAIK the first statement assigns all type glob values to $uid.
The first assigns a typeglob to $uid. This can let you access all the symbol
table entries named REAL_USER_ID through $uid. It's kind of like a
reference, so you have to dereference it to get to the scalar value of
$REAL_USER_ID:
$uid = *REAL_USER_ID;
print "User ID is ", $$uid;
If you do it the following way, you're making uid an alias for REAL_USER_ID:
*uid = *REAL_USER_ID;
print "User ID is ", $uid;
In fact, this is what the English module is doing.
> Am I right? Am I missing something here?
Why are you messing with the typeglob? What are you trying to accomplish?
|