electrosphere has asked for the wisdom of the Perl Monks concerning the following question:
I searched on PM first but found no joy on this specific piece of Perl wisdom, same for perldoc perlrun.
I have changes to a perl module that I want to quickly test from the command line, however perl -M appears to source the module installed in the perl system dir.
Assuming my module is Foo::Bar (package Foo::Bar), and I want to call a function barfoo() in it, I am currently doing:
perl -MFoo::Bar -e 'print barfoo("blah");'
I thought I could make it source the Module in the current dir by using -I. but it didn't work. I realized it would just append this to the end of the @INC array. I then included unshift(@INC, "."); to counter this but it still didn't work.
I'm sure there's a simple way! Thanks
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: perl -M using a module in current dir
by broquaint (Abbot) on Sep 23, 2004 at 11:19 UTC | |
Re: perl -M using a module in current dir
by fergal (Chaplain) on Sep 23, 2004 at 11:21 UTC | |
by electrosphere (Beadle) on Sep 23, 2004 at 12:03 UTC | |
Re: perl -M using a module in current dir
by ikegami (Patriarch) on Sep 23, 2004 at 16:26 UTC |