[VPM] Can't locate method via ...

Carl B. Constantine cconstan at csc.UVic.CA
Mon Jan 26 11:52:47 CST 2004


I have some perl code that was written by someone else. It's a package
that was tacked on the end of a regular perl script. So I ripped it out
and pasted it into it's own package file and gave it a name:
UVic::Tempfiles.

First I get an error about unable to locate UVic/Tempfiles even though I
have a use lib line. It turns out that I had to put it in a UVic subdir.
But other UVic:: modules did not produce that error, so I'm curious why
they don't need to be in the Subdir but mine does?

Anyway, the main point is this module defines the method HoldInput, but
I get this error when I try to create a new version of this object:

Can't locate object method "HoldInput" via package "Tempfiles" (perhaps you forgot to load "Tempfiles"?) at /etc/localhost/arms/lib/UVic/Tempfiles.pm line 29.

But that method IS defined. Additionally, I tried to put it in the
Exporter line at the top of the module file to no avail:

use Exporter;
@ISA = ('Exporter');
@EXPORT=qw(&new
	&HoldInput
	&Temppath);

I've tried putting HoldInput above the 'new' method, also to no avail.

Anyone know what I'm doing wrong? This has worked before just as is
(older perl mind you) and I haven't modified anything, just copy and
paste. So what's up?

The Camel book says that "you called a method correctly, and it
correctly indicated a package functionion as a class, but that package
doesn't define that perticular method, nor does any of its base
classes."

Huh? it does so, right in the package!

-- 
Carl B. Constantine         University of Victoria
Programmer Analyst          http://www.csc.uvic.ca
UNIX System Administrator   Victoria, BC, Canada
cconstan at csc.uvic.ca        ELW A248, 721-8766



More information about the Victoria-pm mailing list