in reply to Using the modules I want to use.

This should work:
#!/usr/local/bin/perl -w use lib '/u/web/dom/cgi-local/'; use CGI ':standard'; use GD; print header, html( h1( "CGI: $CGI::VERSION GD: $GD::VERSION" ) );
You need to modify the @INC path before you load the modules. Also, if you have a module Foo::Bar residing in /some/dir/Foo/Bar.pm you must specify /some/dir/ as the path, without the Foo/ part.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re: Using the modules I want to use.
by cal (Beadle) on Nov 02, 2002 at 06:38 UTC
    Thanks for your help,

    [Sat Nov  2 01:34:17 2002] [error] [client 12.234.205.16] Premature end of script headers: /u/web/dom/cgi-local/whichversion.cgi

    What happens to the modules that you want to include from the server library?

    Cal

      Hmm. Add use CGI::Carp; and check the error log again. There should be a more detailed error message then.

      Also, run with perl -c whichversion.cgi on the shell if you can.

      Makeshifts last the longest.

        Well I dont have telnet but I use a Perl debugger which says the syntax is ok.However these three lines come up .Which are the top three lines.

        #!/usr/local/bin/perl -w use CGI::Carp; use lib '/u/web/dom/cgi-local/';


        (eval 1): Subroutine confess redefined at (eval 1) line 1.
        (eval 1): Subroutine confess redefined at (eval 1) line 2.
        (eval 1): Subroutine confess redefined at (eval 1) line 3.


        ran with carp and same error
      It appears that the use lib line in that loaction causes the "premature end of script" errors, Cal
Re: Re: Using the modules I want to use.
by cal (Beadle) on Nov 02, 2002 at 07:12 UTC
    Well if I put a colon right before the path on the second line there is no error. However I still only see version 1.18..
    #!/usr/local/bin/perl -w<br> use lib ':/u/web/smpsvc/cgi-local';<br> use CGI::Carp;<br> use CGI ':standard';<br> use GD;<br> print header, html( h1( "CGI: $CGI::VERSION GD: $GD::VERSION" ) );<br>

    Cal