Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

(Guildenstern) Re: New module usage

by Guildenstern (Deacon)
on Feb 23, 2001 at 01:13 UTC ( #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.

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 -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.

      Negaterd character class uber alles!

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2020-10-20 08:00 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (209 votes). Check out past polls.