Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Not able to locate method
Vallari
when i try to execute perl script checklinks.ipl,it gives me an error saying Can't locate object method "new" via package "Teamsite:
ath" (perhaps you forgot to load "Teamsite:
ath"?) at i:\iw-home\local\bin\check_links.ipl line 47.
Find more posts tagged with
Comments
Adam Stoller
Well - since the only script in iw-home/local/bin that is shipped with the product is unlock.ipl - check_links.ipl must be a custom script.
Also - TeamSite:
ath *sounds* like a product file - but I don't recall ever seeing a module by that name shipped with the product - so that too is likely to be a custom file.
Without seeing the script *and* the module - I don't think there is too much we can do other than to suggest:
(a) Make sure there is a file called "TeamSite/Path.pm" sitting somewhere on the
@INC
path for iwperl
(b) Make sure the check_links.ipl includes that module (use TeamSite:
ath
correctly
(c) Make sure that TeamSite:
ath provides a 'new' method
(d) Examine line 47 of check_links.ipl to determine how it is being called.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Vallari
Thank you for the response.
I am hereby attaching the check_links.ipl along with the path.pm...module
Regards,
Gauri
Adam Stoller
You might have *intended* to attach them - but you didn't manage to do so ;-)
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Vallari
Hi,
I am hereby attaching the Path.pm and Check_links.ipl file.
Regards,
Gauri
Vallari
Hello,
I ahve sent the path.pm in my previous response and now sending you the check_links.ipl.
Regards,
Gauri
haplo
There is no 'sub new' in the path package...Trying to use a function that don't exist will not work.You cannot do '$area=new TeamSite:
ath'.
Are you sure to use the library correctly?I didn't see a new function used in the synopsis or in the description.
Adam Stoller
First of all, it looks like "TeamSite:
ath" - is *really* File:
ath - that being the case, you should be able to get rid of TeamSite/Path.pm and change the inclusion line in check_links.ipl from:
use TeamSite:
ath qw(mkpath);
to:
use File:
ath qw(mkpath);
Secondly, as was already pointed out - there is no 'new' method for File:
ath - there are only two potentially exported methods: mkpath() and rmtree() - and you explicitly are stating at the inclusion line that you only want to reference the first one.
Here are some changes I would suggest for check_links.ipl - whether or not this leaves you with a fully functional program I won't guarantee, but ...
Remove this entire section:
use TeamSite:
ath qw(
$IWMNT
$IWHOME
$DEV_NULL
$TEMPLATEDATA
);
it does nothing, it's incorrect, get rid of it.
As stated before, change:
use TeamSite:
ath qw(mkpath);
to:
use File:
ath qw(mkpath);
Change:
my $area=new TeamSite:
ath($TASK->GetArea);
to:
my $area = $TASK->GetArea();
Change:
my $path=new TeamSite:
ath($File::Find::name);
to:
my $path = $File::Find::name;
I'd also suggest adding '-w' on the #! line (
.../iwperl -w
) After making those changes and saving the file, run the following from the command line:
iwperl -w -c check_links.ipl
to find any other issues the script might have.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Vallari
Hello,
Thank you for the suggestions.
I have made the following changes in check_links.ipl.
Now ,when i am trying to compiole check_links.ipl it gives me the following error.
Can't locate Find/Path.pm in
@INC
<.
@INC
contains i:/iw-home\iw-perl\lib i:iw-home\iw-perl\site\lib i:\iw-home\iw-perl\vendor\lib.
After,i got this error,i checked for path.pm under-->i:\iw-home\iw-perl\lib
i:\iw-home\iw-perl\site\lib
i:\iw-home\iw-perl\vendor\lib
and found that path.pm is present under all the following directories.
I also copied again path.pm under all the following directories.
But still it gives me the same problem.
i executed iw-reset after i copied path.pm under the followinf directories.
Can you help me in resolving this error.
Regards,
Gauri
I
haplo
Teamsite and perl are not directly linked,doing a iwreset does nothing on Perl.Perl is not a service, it' a interpreter...
You should only have one path.pm under the ****\iw-perl\lib\File directory,having multiple time the same package is a really bad idea.
Adam Stoller
It's
File
:
ath
not
Find
:
ath
You should
not
have to copy
P
ath.pm
(
not
p
ath.pm
) anywahere - it should already exist as
iw-home
/iw-perl/lib/File/Path.pm
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Vallari
Thanks for the response.