Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: newbie question: can't use my own lib in crob job

by iwanthome (Beadle)
on Mar 30, 2004 at 02:47 UTC ( [id://340836]=note: print w/replies, xml ) Need Help??


in reply to Re: newbie question: can't use my own lib in crob job
in thread newbie question: can't use my own lib in crob job

I try
use File::Basename; my $cwd = dirname $0; my $libpath = $cwd."/lib"; require "$libpath/My/Ownmodule.pm";

it is work normally. And putting "require File::Basename;" inside the BEGIN block can't solve the problem

What is the difference between "require" and "use" ? Are there any disadvantage to use "require" to replace "use" ?

I am in doubt whether there are any other method can make me to use  "use lib "xxxx"

thanks!

Replies are listed 'Best First'.
Re: Re: Re: newbie question: can't use my own lib in crob job
by Anonymous Monk on Mar 30, 2004 at 04:19 UTC
    What is the difference between "require" and "use" ? Are there any disadvantage to use "require" to replace "use" ?
    perldoc -f use
    perldoc -f require

    I am in doubt whether there are any other method can make me to use "use lib "xxxx"
    Sorry, can you translate that to English?

      I am so sorry because my native language is not English.So I can't express my question exactly.

      My question is : is it possible that use "use lib" in my cron job?

      I don't know whether I express clearly.

      thanks!
        How about this
        use lib "$ENV{HOME}/lib";
        and then you tell users they must keep the module in ~/lib

      I am so sorry English is not my native language.So I can't express my question exactly.

      My question is:

      How can I use use lib "xxx/mylib" in my script if I don't use require "xxx/mylib/sss.pm"? I just want to know whether it is possible .

      thanks!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-25 10:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found