Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: import duties

by tcf22 (Priest)
on Dec 24, 2003 at 14:57 UTC ( #316858=note: print w/ replies, xml ) Need Help??


in reply to import duties

    I expected 3rd way to work just like the others, by creating a my variable in main.

If you use Devel::Symdump, you'll see that my variables, aren't actually in the main package, they are local to the block.. The list outputted by the following code, shows all scalar symbols in the main package.

#! /usr/bin/perl use strict; use Devel::Symdump; my $obj = Devel::Symdump->new('main'); my $var1 = 'var1'; our $var2 = 'var2'; foreach($obj->scalars){ print "$_\n"; } __OUTPUT__ ...Builtin Vars... main::var2 ...More Builtin Vars...
Update: Fixed misplaced sentence fragment.

- Tom


Comment on Re: import duties
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://316858]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (18)
As of 2014-07-14 13:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (259 votes), past polls