Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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

by tye (Sage)
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        

Replies are listed 'Best First'.
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
    perl -w test/ Global symbol "%runSwitches" requires explicit package name at test/fa line 8. Global symbol "%runSwitches" requires explicit package name at test/fa line 16. Execution of test/ 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 Add 'require Exporter;' or 'use Exporter;'.

      - tye        

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://939704]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2017-12-18 05:22 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (467 votes). Check out past polls.