in reply to (Guildenstern) Re: New module usage
in thread New module usage

Where do I enter in the command line switch? Can I just add it to my script somehow?
  • Comment on Re: (Guildenstern) Re: New module usage

Replies are listed 'Best First'.
Re: Re: (Guildenstern) Re: New module usage
by Adam (Vicar) on Feb 23, 2001 at 01:19 UTC
    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.)
Re: Re: (Guildenstern) Re: New module usage
by elusion (Curate) on Feb 23, 2001 at 01:19 UTC
    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

(Guildenstern) Rex3: New module usage
by Guildenstern (Deacon) on Feb 23, 2001 at 01:20 UTC
    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!