Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

path problem
Hi all

Iv'e downloaded a pdf module from CPAN and am trying to use it in my
webspace provided by Demon Internet (www.demon.net) but no matter what I try
it cannot 'find' the module called Reuse.pm which IS in the same directory
as the following script.

!/usr/bin/perl
use lib "$ENV{'DOCUMENT_ROOT'}/pdftest";
use CGI::Carp qw(fatalsToBrowser);
use Reuse;
use PDF::Reuse;
print "Content-type: text/html\n\n";
print "<HTML><BODY>Finished</BODY></HTML>";


It stops on the "use PDF::Reuse;" statement saying it can't find the module
at yet the Use Reuse does not cause an error and the error shows the @inc
path which contains the full path to my working directory.

I've tried Demon's technical support but they offered very little advice

Thanks in advance for your help

Andrew Kennard




Report this thread to moderator Post Follow-up to this message
Old Post
Andrew Kennard
04-07-05 01:55 AM


Re: path problem
On Wed, 6 Apr 2005 16:46:43 +0100, a.kennard@btinternet.com (Andrew
Kennard) wrote:

>Iv'e downloaded a pdf module from CPAN and am trying to use it in my
>webspace provided by Demon Internet (www.demon.net) but no matter what I tr
y
>it cannot 'find' the module called Reuse.pm which IS in the same directory
>as the following script.
>
>!/usr/bin/perl
>use lib "$ENV{'DOCUMENT_ROOT'}/pdftest";
>use CGI::Carp qw(fatalsToBrowser);
>use Reuse;
>use PDF::Reuse;
>print "Content-type: text/html\n\n";
>print "<HTML><BODY>Finished</BODY></HTML>";
>
>
>It stops on the "use PDF::Reuse;" statement saying it can't find the module
>at yet the Use Reuse does not cause an error and the error shows the @inc
>path which contains the full path to my working directory.
>
>I've tried Demon's technical support but they offered very little advice

2 things to try:

Instead of:
use lib "$ENV{'DOCUMENT_ROOT'}/pdftest";
try
use lib ".";

In "." , create a directory called PDF, and put Reuse.pm
into PDF.

There is an internal naming of modules, at the top of the .pm
file, where the package is declared.
In your case, Reuse.pm should have "package PDF::Reuse" at
the top. You can change that to just "package Reuse" and avoid having
the PDF directory.

I don't know why the "use lib "$ENV{'DOCUMENT_ROOT'}/pdftest";
dosn't work, but I'm guessing Perl dosn't like nested variables in it's
use statements?




--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html

Report this thread to moderator Post Follow-up to this message
Old Post
Zentara
04-08-05 08:55 PM


Re: path problem
> >use lib "$ENV{'DOCUMENT_ROOT'}/pdftest";

use lib is done at compile time. the %ENV isn't available til run-time IIRC.

Report this thread to moderator Post Follow-up to this message
Old Post
Shaun Fryer
04-08-05 08:55 PM


Re: path problem
On Fri, 08 Apr 2005 11:59:12 -0400, Shaun Fryer wrote: 
>
> use lib is done at compile time. the %ENV isn't available til run-time IIRC.[/colo
r]

False:

$ perl -le 'print grep /peter/ => @INC'

$ perl -le 'use lib $ENV{HOME}; print grep /peter/ => @INC'
/home/peter
$

--
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/


Report this thread to moderator Post Follow-up to this message
Old Post
Peter Scott
04-09-05 08:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL CGI Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:59 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.