Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by throop (Chaplain)
on Nov 30, 2011 at 15:46 UTC ( #940884=note: print w/ replies, xml ) Need Help??


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

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.


Comment on Re^2: Code in package hell, deceive by debugger (T,IFI)
Select or Download Code
Re^3: Code in package hell, deceive by debugger (bug2)
by tye (Cardinal) on Nov 30, 2011 at 19:28 UTC

    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://940884]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2014-12-25 23:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (163 votes), past polls