Tripod wont find my lib files

Discussion in 'Perl Misc' started by javatiger, Apr 25, 2004.

  1. javatiger

    javatiger Guest

    Every time I upload a library file into my cgi bin, tripod refuses to
    find it and comes up with an error.

    It looks like there was an error:

    Your script produced this error:
    Can't locate File/Glob.pm in @INC (@INC contains: . / /lib /site_perl)
    at msg.pl line 8.
    BEGIN failed--compilation aborted at msg.pl line 8.

    I get usual scripts to work but just can't get the lib ones too.

    Is there something I need to be doing?

    Cheers
    javatiger, Apr 25, 2004
    #1
    1. Advertising

  2. javatiger

    Bob Walton Guest

    javatiger wrote:

    > Every time I upload a library file into my cgi bin, tripod refuses to


    -------------------------------------^^^^^^^^^^^^^^^

    What's "tripod"?


    > find it and comes up with an error.
    >
    > It looks like there was an error:
    >
    > Your script produced this error:
    > Can't locate File/Glob.pm in @INC (@INC contains: . / /lib /site_perl)


    ----------------------------------------------------^^^^^^^^^^^^^^^^^^^

    Is your "cgi bin" one of the above directories? (hint: your web server
    may not start your CGI routines with the current directory being the
    directory in which the CGI routines reside). If not, loading a "library
    file" there will do no good, as Perl is only searching the directories
    in @INC for library routines. Maybe you should instead load the
    "library file" into one of those directories. Or put a "use lib ..."
    statement into your program which tells Perl to search the place where
    you put the files.


    > at msg.pl line 8.
    > BEGIN failed--compilation aborted at msg.pl line 8.
    >

    ....

    --
    Bob Walton
    Email: http://bwalton.com/cgi-bin/emailbob.pl
    Bob Walton, Apr 26, 2004
    #2
    1. Advertising

  3. javatiger

    javatiger Guest

    What's "tripod"?

    Its a free webhosting site with cgi, http://www.tripod.lycos.com/

    This is the script that I have loaded into the cgi bin
    -------------------------------------------------------------------
    #!/usr/bin/perl
    require "formparser.lib"; &parseform;
    $txt = $formdata{'msg'};
    $name = $formdata{'from'};
    open( TXT, ">>messages.txt" );
    print TXT "Message: $txt - From $name \n";
    close(TXT);
    open( DATA, "<messages.txt" );
    @data = < DATA >;
    close( DATA );
    print "Content-type:text/html\n\n";
    foreach $item(@data){ print "<li>$item"; }

    ------------------------------------------------------------------------
    and ive uploaded the formparser lib
    -------------------------------------------------------------------------
    sub parseform
    {
    if( $ENV{'REQUEST_METHOD'} eq 'GET' )
    { @pairs = split( /&/, $ENV{'QUERY_STRING'} ); }
    elsif( $ENV{'REQUEST_METHOD'} eq 'POST' )
    {
    read( STDIN, $buffer, $ENV{'CONTENT_LENGTH'} );
    @pairs = split( /&/, $buffer );
    if( $ENV{'QUERY_STRING'} )
    { @getpairs = split( /&/, $ENV{'QUERY_STRING'} );
    push( @pairs, @getpairs ); }
    }
    else
    {
    print "Content-type:text/html\n\n";
    print "Unrecognized Method - Use GET or POST.";
    }
    foreach $pair( @pairs )
    {
    ( $key, $value ) = split( /=/, $pair );
    $key =~ tr/+/ /;
    $value =~ tr/+/ /;
    $key =~ s/%(..)/pack("c", hex($1))/eg;
    $value =~ s/%(..)/pack("c", hex($1))/eg;
    $value =~ s/<!--(.|\n)*-->//g; # ignore SSI
    if( $formdata{$key} ){$formdata{$key} .= ", $value";}
    else{ $formdata{$key} = $value; }
    } }
    1;
    ---------------------------------------------------------------------

    But it throws the error.

    Could you edit what need to be changed please.

    ---------------------------------------------------------------------

    Bob Walton <> wrote in message news:<>...
    > javatiger wrote:
    >
    > > Every time I upload a library file into my cgi bin, tripod refuses to

    >
    > -------------------------------------^^^^^^^^^^^^^^^
    >
    > What's "tripod"?
    >
    >
    > > find it and comes up with an error.
    > >
    > > It looks like there was an error:
    > >
    > > Your script produced this error:
    > > Can't locate File/Glob.pm in @INC (@INC contains: . / /lib /site_perl)

    >
    > ----------------------------------------------------^^^^^^^^^^^^^^^^^^^
    >
    > Is your "cgi bin" one of the above directories? (hint: your web server
    > may not start your CGI routines with the current directory being the
    > directory in which the CGI routines reside). If not, loading a "library
    > file" there will do no good, as Perl is only searching the directories
    > in @INC for library routines. Maybe you should instead load the
    > "library file" into one of those directories. Or put a "use lib ..."
    > statement into your program which tells Perl to search the place where
    > you put the files.
    >
    >
    > > at msg.pl line 8.
    > > BEGIN failed--compilation aborted at msg.pl line 8.
    > >

    > ...
    javatiger, Apr 26, 2004
    #3
  4. Bob Walton wrote:

    > javatiger wrote:
    >
    >> Every time I upload a library file into my cgi bin, tripod refuses to

    >
    >
    > -------------------------------------^^^^^^^^^^^^^^^
    >
    > What's "tripod"?
    >
    >
    >> find it and comes up with an error.
    >>
    >> It looks like there was an error:
    >> Your script produced this error: Can't locate File/Glob.pm in @INC
    >> (@INC contains: . / /lib /site_perl)

    >
    >
    > ----------------------------------------------------^^^^^^^^^^^^^^^^^^^
    >
    > Is your "cgi bin" one of the above directories? (hint: your web server
    > may not start your CGI routines with the current directory being the
    > directory in which the CGI routines reside). If not, loading a "library
    > file" there will do no good, as Perl is only searching the directories
    > in @INC for library routines. Maybe you should instead load the
    > "library file" into one of those directories. Or put a "use lib ..."
    > statement into your program which tells Perl to search the place where
    > you put the files.


    Tripod provides _no_ Perl library modules, requiring everything to be in
    the user's cgi-bin directory. They supply an obsolete version of perl5,
    an even more obsolete version of CGI.pm, and about four modules of their
    own composition. All of these you have to download from them and then
    upload into your cgi-bin directory.

    File/Glob.pm, of course, would have to put into a subdirectory of
    cgi-bin named File.

    --
    John W. Kennedy
    "Sweet, was Christ crucified to create this chat?"
    -- Charles Williams. "Judgement at Chelmsford"
    John W. Kennedy, Apr 26, 2004
    #4
  5. javatiger

    Bob Walton Guest

    javatiger wrote:

    > What's "tripod"?
    >
    > Its a free webhosting site with cgi, http://www.tripod.lycos.com/
    >
    > This is the script that I have loaded into the cgi bin
    > -------------------------------------------------------------------
    > #!/usr/bin/perl



    You are missing:

    use warnings; #if your Perl is too old to support this, add -w
    #to the #! line above
    use strict;
    use CGI; #when you are dealing with a CGI script, you should
    #really make use of the CGI module. Not to do so is
    #to invite gobs of errors and make lots and lots of
    #additional work for you.


    > require "formparser.lib"; &parseform;


    ----------------------------^
    Minor pick: You should only use & in front of a sub call if you
    want the behaviors it generates. You don't, so use:

    parseform();

    instead. And, of course, you should really be using the CGI
    module to "parse your form".

    my %formdata; #used as a global in your sub below


    > $txt = $formdata{'msg'};


    my $txt = ...


    > $name = $formdata{'from'};


    my $name = ...


    > open( TXT, ">>messages.txt" );
    > print TXT "Message: $txt - From $name \n";
    > close(TXT);
    > open( DATA, "<messages.txt" );


    --------^^^^
    This is a special filehandle in Perl. You can use it as
    you did, but you should really choose a different name.


    > @data = < DATA >;


    -----------^----^
    my @data = <DATA>;

    Get rid of the spaces in the <...> operator. That
    is the source of the call to module File::Glob
    which isn't being found. Read the docs on the
    <...> operator very carefully to see why this is
    the case:

    perldoc perlop

    particularly the section on I/O operators.


    > close( DATA );
    > print "Content-type:text/html\n\n";
    > foreach $item(@data){ print "<li>$item"; }


    my $item(...


    >
    > ------------------------------------------------------------------------
    > and ive uploaded the formparser lib
    > -------------------------------------------------------------------------
    > sub parseform
    > {



    my @pairs;


    > if( $ENV{'REQUEST_METHOD'} eq 'GET' )
    > { @pairs = split( /&/, $ENV{'QUERY_STRING'} ); }
    > elsif( $ENV{'REQUEST_METHOD'} eq 'POST' )
    > {
    > read( STDIN, $buffer, $ENV{'CONTENT_LENGTH'} );
    > @pairs = split( /&/, $buffer );
    > if( $ENV{'QUERY_STRING'} )
    > { @getpairs = split( /&/, $ENV{'QUERY_STRING'} );


    my @getpairs = ...


    > push( @pairs, @getpairs ); }
    > }
    > else
    > {
    > print "Content-type:text/html\n\n";
    > print "Unrecognized Method - Use GET or POST.";
    > }
    > foreach $pair( @pairs )


    my $pair ...


    > {
    > ( $key, $value ) = split( /=/, $pair );


    my($key,$value) = ...


    > $key =~ tr/+/ /;
    > $value =~ tr/+/ /;
    > $key =~ s/%(..)/pack("c", hex($1))/eg;
    > $value =~ s/%(..)/pack("c", hex($1))/eg;
    > $value =~ s/<!--(.|\n)*-->//g; # ignore SSI
    > if( $formdata{$key} ){$formdata{$key} .= ", $value";}
    > else{ $formdata{$key} = $value; }
    > } }
    > 1;
    > ---------------------------------------------------------------------
    >
    > But it throws the error.
    >
    > Could you edit what need to be changed please.
    >
    > ---------------------------------------------------------------------
    >
    > Bob Walton <> wrote in message news:<>...
    >

    ....

    --
    Bob Walton
    Email: http://bwalton.com/cgi-bin/emailbob.pl
    Bob Walton, Apr 27, 2004
    #5
  6. javatiger

    Robin Guest

    "javatiger" <> wrote in message
    news:...
    > Every time I upload a library file into my cgi bin, tripod refuses to
    > find it and comes up with an error.
    >
    > It looks like there was an error:
    >
    > Your script produced this error:
    > Can't locate File/Glob.pm in @INC (@INC contains: . / /lib /site_perl)
    > at msg.pl line 8.
    > BEGIN failed--compilation aborted at msg.pl line 8.
    >
    > I get usual scripts to work but just can't get the lib ones too.
    >
    > Is there something I need to be doing?
    >
    > Cheers


    try www.free-webhosts.com - and specify the full path to your library,
    you'll probably have to find out from tripod. It might be something like
    /usr/home/myuser or something.
    -Robin
    Robin, Apr 27, 2004
    #6
  7. javatiger

    Bob Walton Guest

    Bob Walton wrote:

    > javatiger wrote:
    >

    ....
    >
    >
    >> open( TXT, ">>messages.txt" );



    Oh yeah, and *always* check your open statements to see if
    they succeeded or not, like:

    open TXT,">>messages.txt" or
    die "Oops, couldn't open messages.txt for append, $!";

    print TXT "Message: $txt - From $name \n";


    close(TXT);



    >> open( DATA, "<messages.txt" );



    open DATA,"<messages.txt" or
    die "Oops, couldn't open messages.txt for read, $!";


    ....

    --
    Bob Walton
    Email: http://bwalton.com/cgi-bin/emailbob.pl
    Bob Walton, Apr 27, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James Yong
    Replies:
    0
    Views:
    538
    James Yong
    Sep 12, 2005
  2. Praetorian

    Need odbc32.lib odbccp32.lib

    Praetorian, Apr 20, 2006, in forum: C++
    Replies:
    1
    Views:
    1,364
    mlimber
    Apr 20, 2006
  3. Durduran
    Replies:
    10
    Views:
    524
    Durduran
    Jul 30, 2007
  4. Replies:
    3
    Views:
    2,734
  5. joesplink
    Replies:
    16
    Views:
    249
    joesplink
    Apr 9, 2005
Loading...

Share This Page