?
Solved

Perl 5.004_04 built for sun4-solaris - object oriented programming calls

Posted on 2003-03-10
2
Medium Priority
?
159 Views
Last Modified: 2013-12-25
Do they work?

I'm trying to run this script which should print a single line to the browser:

#!/usr/bin/perl -wT
use File::Spec;
print "Content-type: text/html\n\n";
$x=File::Spec->catfile('a', 'b', 'c');
print "File::Spec->catfile('a', 'b', 'c') = $x";
exit 0;

but it simply fails with a

[Mon Mar 10 15:09:10 2003] Can't locate object method "catfile" via package
"File::Spec" at form.cgi line 4.

This message appears whenever I try and use certain modules and no matter
what method is being called within the module.

Any clues as to where I'm going wrong? ...

Sam.

P.S. I'm developing on a system which I have no access to bar the cgi-bin.  It's some kind of a custom build, I think because it doesn't appear to have some of the default modules - CGI.pm works fine but File::Spec does not, even tho I *think* that was bundled with this version of perl as default.  I have tried adding a File directory to my cgi-bin and putting all the associated Spec.pm and files in the Spec dir inside there.  This lets the script find the files but causes the error above.
0
Comment
Question by:samwise
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 500 total points
ID: 8118548
sounds like an incomplete installation.
try to check with following print command (in your cgi):

 print "Content-type: text/html\n\nV=$File::Spec::VERSION";
0
 

Author Comment

by:samwise
ID: 8118578
Yep, it's a non-standard build which doesn't include the File::Spec library amongst others.  I've managed to work around it by copying the File::Spec files into my cgi-bin.  Not nice but the best I can do.

Peter.
0

Featured Post

Use Filtering Commands to Process Files in Linux

Learn how to manipulate data with the help of various filtering commands such as `cat`, `fmt`, `pr`, and others in Linux.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question