Link to home
Start Free TrialLog in
Avatar of samwise
samwise

asked on

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

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.
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of samwise
samwise

ASKER

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.