Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

(Guildenstern) Re: New module usage

by Guildenstern (Deacon)
on Feb 23, 2001 at 01:13 UTC ( [id://60333]=note: print w/replies, xml ) Need Help??


in reply to New module usage

It will use the one installed on the system before the one you have modified. I ran into the same problem while making a bug fix in a module I've written. I got my script to see the correct module by using the command line switch -I. (that's a dot). That will make the current directory the first entry in @INC, which means it will be searched first for modules. That should cause your module to be located before the installed one and used instead.

Guildenstern
Negaterd character class uber alles!

Replies are listed 'Best First'.
Re: (Guildenstern) Re: New module usage
by Anonymous Monk on Feb 23, 2001 at 01:16 UTC
    Where do I enter in the command line switch? Can I just add it to my script somehow?
      Yes. My answer is equivalent to -I, but is internal to the script. Also, you can put flags on the #! line at the begining of your script:
      #!/usr/bin/perl -w -I. use strict; use ModuleToTest;
      is the same as
      #!/usr/bin/perl -w use strict; use lib '.'; use ModuleToTest;
      I happen to like the use_lib method better, as it is more readilly apparent what you are doing (but still might warrant a comment.)
      To do it that way you type it in the prompt like this:
      C:\>perl script.pl -l.

      - p u n k k i d
      "Reality is merely an illusion, albeit a very persistent one." -Albert Einstein

      Well, you can do like Adam suggested. I believe (but am not 100% sure) that you can make the -I. part of your hash-bang line: !#/usr/bin/perl -w -I.
      I'm coming from the NT world, so I'm used to using it as I call the script: perl -I. myscript.pl

      Guildenstern
      Negaterd character class uber alles!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-25 10:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found