develooper Front page | perl.perl5.porters | Postings from April 2003

$main::main::main::main::main::x == $main::x why?

Thread Next
From:
Michael G Schwern
Date:
April 15, 2003 15:08
Subject:
$main::main::main::main::main::x == $main::x why?
Message ID:
20030415220817.GE2904@windhund.schwern.org
This just came up on #perl:

$ perl -wle '$main::main::main::main::x = 2;  print $x'
2

apparently because $main::{'main::'} exists as a reference back to *main?

Why does this work this way?


-- 
I do have a cause though.  It is obscenity.  I'm for it.
    -- Tom Lehrer "Smut"

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About