Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

by throop (Chaplain)
on Nov 30, 2011 at 15:46 UTC ( [id://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.

Replies are listed 'Best First'.
Re^3: Code in package hell, deceive by debugger (bug2)
by tye (Sage) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://940884]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2024-03-28 21:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found