Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Code in package hell, deceive by debugger (T,IFI)

by tye (Cardinal)
on Nov 23, 2011 at 17:44 UTC ( #939704=note: print w/ replies, xml ) Need Help??


in reply to Code in package hell, deceive by debugger

use base::Vars qw(%runSwitches); # use vars qw(%runSwitches);

- tye        


Comment on Re: Code in package hell, deceive by debugger (T,IFI)
Download Code
Re^2: Code in package hell, deceive by debugger (T,IFI)
by throop (Chaplain) on Nov 30, 2011 at 15:46 UTC
    Thanks... but when I do that, I get fatal errors. E.g., with
    package test::facetsIn; use strict; use base::Vars qw(%runSwitches); use Carp; # use vars qw(%runSwitches); sub orionDirs{ print("safer::Indenture::facetsIn's directories: " , join(' ', sort keys %{$runSwitches{directories}}), "\n"); print("base::Vars::runSwitches' directories: ", join(' ', sort keys %{$base::Vars::runSwitches{directories}}), "\n"); print("main::runSwitches{directories}'s directories: " , join(' ', sort keys %{$main::runSwitches{directories}}), "\n"); croak unless $runSwitches{directories}{orion_reqs} } 1
    and
    perl -w test/facetsIn.pm Global symbol "%runSwitches" requires explicit package name at test/fa +cetsIn.pm line 8. Global symbol "%runSwitches" requires explicit package name at test/fa +cetsIn.pm line 16. Execution of test/facetsIn.pm aborted due to compilation errors.

      Then that means that your exporting code is broken:

      package base::Vars; # Actually a bunch of others vars in here, but I'm simplifying. use vars qw( %runSwitches ); our @ISA = qw(Exporter); our @EXPORT = qw(%runSwitches);

      Since you hint that this isn't actually the code that you ran and had the problem with, it is risky for me to declare what the problem with it is. But there is certainly a potential problem.

      You don't actually load Exporter.pm. Add 'require Exporter;' or 'use Exporter;'.

      - tye        

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://939704]
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 14:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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








    Results (262 votes), past polls