Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: require issue.

by ant (Scribe)
on Mar 02, 2007 at 13:29 UTC ( #602874=note: print w/replies, xml ) Need Help??


in reply to Re: require issue.
in thread require issue.

After posting that request for help I continued looking for a solution and came up with this.

in newform.pm I commented out the require statement
package newform; #require "somefile.pl"; sub func1 { main::someFile1(); print "Inside func1"; } 1;
I left the Requires('somefile.pl') in the Main.pl, Then, when in the newform.pm and I wanted to use the someFile1 function I called main::someFile1(); This seemed to work!

Thanks all for looking into this also.

Replies are listed 'Best First'.
Re^3: require issue.
by ysth (Canon) on Mar 02, 2007 at 17:16 UTC
    Or put a package main; at the beginning of somefile.pl; that way each other file that uses something from somefile.pl makes sure that it's loaded, but always knows what package to expect it to be loaded into.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://602874]
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: (5)
As of 2023-01-30 18:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?