in reply to RE: Re: question about variabies/references (ignore my previous botched entry)
in thread question about variabies/references (ignore my previous botched entry)

You're right, the post-interpolated line should read: *main::scott = "scot2"; Here's what I've been using to test my assumptions:
#!/usr/bin/perl $test1 = "value of test1"; $test2 = "test1"; $test3 = "Why are you here?"; # refers to *main::test1 print "=>$main::{$test2}<=\n"; print "Original \$test1: ...$test1...\n"; $main::{$test2} = "test3"; # $main::{"test1"} = "test1"; print "\$test1 = >>", $test1, "<<\n"; print "Main package: ", $main::test1, "\n";
As you can see, $main::{$test2} evaluates to a typeglob. Saying that $main::{$test2} = "test3" changes the scalar is technically incorrect. (Though it is what my previous answer would lead one to believe!)

Dunno where that u came from. Maybe it's a mu?

Replies are listed 'Best First'.
RE: uSymbol Table Madness
by btrott (Parson) on Apr 05, 2000 at 22:30 UTC
    chromatic wrote:
    > As you can see, $main::{$test2} evaluates to a typeglob.
    Right; because a typeglob *is* an entry in the symbol table.

    > Saying that $main::{$test2} = > "test3" changes the scalar is technically incorrect.
    Sorry, did I say that?