beginr has asked for the wisdom of the Perl Monks concerning the following question:

have two pl files different locations

1./var/apache/cgi-bin/pomap.pl

2 /home/cg204017/test.pl

I am want to use the function in test.pl in pomap.pl.

I am using the following code.

#!/usr/bin/perl use lib "/home/cg204017"; use strict; use warnings; use diagnostics; use DBI; use CGI qw/:standard/; require 'test.pl';

when i am running (./pomap.pl)in terminal it shows no error. i am opening the same in browser its not working

please help me out

Code tags added by GrandFather

Replies are listed 'Best First'.
Re: including one .pl file in another
by davorg (Chancellor) on Sep 15, 2006 at 10:53 UTC

    (You make it hard for us to help, by not taking the time to format your posts readably. Please read Writeup Formatting Tips)

    Your web server runs under a different user than the one you use when you run programs from the command line. I would guess that the web server user doesn't have permission to read files from the directory that contains your library file. I'm pretty sure that there will be a message in your web server error log that confirms this.

    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

Re: including one .pl file in another
by blue_cowdawg (Monsignor) on Sep 15, 2006 at 12:32 UTC
        when i am running (./pomap.pl)in terminal it shows no error. i am opening the same in browser its not working

    At the risk of being repetitive: what do the server's error logs say? As davorg has already pointed out, this definitely sounds like a permissions issue.


    Peter L. Berghold -- Unix Professional
    Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg