Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Howto set path for local package in a Perl code

by krisahoch (Deacon)
on Jun 01, 2006 at 17:56 UTC ( [id://553104]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Howto set path for local package in a Perl code
in thread Howto set path for local package in a Perl code

neversaint, try this code.
This is for you script file 'mycode.plx'
# In script file named: mycode.plx use strict; use warnings; use diagnostics; # This just gives you more info. use lib '/home/neversaint/MyPerl/src'; use MyPackage; # Now the rest of your code.
This is for your package file 'MyPackage.pm'
# In MyPackage.pm package MyPackage; use strict; use warnings; use diagnostics; sub some_function { print("My some function"); }
Now here is the important part. The use statement, the file name, and the package declaration MUST all be in the same case.
  • Use statement: use MyPackage;
  • File Name: MyPackage.pm
  • Package statement: package MyPackage;
Kristofer Hoch

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://553104]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-20 01:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found