in reply to Re: Undefined subroutine
in thread Undefined subroutine

I have run
perl -MTest -le print $INC{"J9Test.pm"};
(as I renamed my module) on my MS machine but get a blank line returned.

Replies are listed 'Best First'.
Re: Re: Re: Undefined subroutine
by broquaint (Abbot) on Mar 11, 2003 at 14:45 UTC
    ... (as I renamed my module) on my MS machine but get a blank line returned.
    That's to be expected as you're no longer including Test.pm. If you change the -M switch to -MJ9Test it will output the path to J9Test.pm relative to @INC.
    HTH

    _________
    broquaint

      BLUSH..

      Tried ...
      perl -MJ9Test -le print $INC{"J9Test.pm"};
      Still got a blank line though.
        Quotes are your friend ...
        shell> cat > J9Test.pm package J9Test; 1; shell> perl -MJ9Test -le print $INC{"J9Test.pm"}; shell> perl -MJ9Test -le print@ARGV $INC{"J9Test.pm"}; {J9Test.pm} shell> perl -MJ9Test -le 'print $INC{"J9Test.pm"};' J9Test.pm
        Although the above was performed on a linux box using bash (so you might get a different result in a different shell), I'm pretty sure that $INC{"J9Test.pm"} is being passed as the last argument to perl.
        HTH

        _________
        broquaint