Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2003-03-10
2
Medium Priority
?
165 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
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

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

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

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

571 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