Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Can't locate Object/ Error

by Vijay81 (Acolyte)
on Nov 28, 2012 at 11:02 UTC ( #1006007=perlquestion: print w/replies, xml ) Need Help??
Vijay81 has asked for the wisdom of the Perl Monks concerning the following question:

Hi All Am new to perl and i have install ActivePerl in my windows Xp 32 bit system. Am trying to run a small script which create a xml file using use XML::Smart module. when ever i tried to run the script i get the below error, not sure where am making mistake. Any help please Error :

C:\QA\Projects\Perl>perl Can't locate Object/ in @INC (@INC contains: C:\Perl\lib\P +LJava-0.04 C:/Perl/site/lib C:/Perl/lib .) at C:/Perl/lib/XML/ line 18. BEGIN failed--compilation aborted at C:/Perl/lib/XML/ line 18. Compilation failed in require at line 3. BEGIN failed--compilation aborted at line 3.
Script file content is :
#!/bin/perl -w use lib 'C:\Perl\lib\PLJava-0.04'; use XML::Smart; ## Create a null XML object: my $XML = XML::Smart->new() ; ## Add a xml server to the list: $XML->{configuration} = { version => '' , savepassword => 'True' , } ; $XML->save('newfile.xml') ;

Also, i need to know how to install the perl modules using PPM window and if any of the modules installed manually(tar files,unzipped) then where we need to put those module files into(location) ??? Thanks, V

Replies are listed 'Best First'.
Re: Can't locate Object/ Error
by marto (Bishop) on Nov 28, 2012 at 11:10 UTC

    You haven't installed XML::Smart correctly, it's dependencies are not satisfied, Object::MultiType.

    You don't mention how you installed XML::Smart, if you think downloading the tar files and copying files to places is a good idea, it isn't.

    To install using ppm from the command prompt:

    ppm Module::Name

    To install using cpan from the command prompt:

    cpan Module::Name

    Either method will install the module and it's dependencies. If you use the cpan method consider installing MinGW and the build tools for your version of ActiveState Perl by:

    ppm MinGW

    Note also the XML::Smart module is quite old and has several reported bugs you may want to make yourself aware of. I'd never heard of it before you mentioned it. Perhaps one of the more modern, supported XML modules would suffice.

    Update: See also PerlMonks for the Absolute Beginner, since you posted in the wrong section of the forum.

      Thank you All. It worked.
Re: Can't locate Object/ Error
by choroba (Bishop) on Nov 28, 2012 at 11:08 UTC
Re: Can't locate Object/ Error
by tobyink (Abbot) on Nov 28, 2012 at 11:08 UTC

    You need to install Object::MultiType.

    If you want to install a module manually, uncompress it, then at the command line, cd to the uncompressed directory and run the following four commands:

    perl Makefile.PL make make test make install

    Don't try to faff around copying modules to lib dirs by hand. Many packages need to build or configure stuff at install time, so you need to run make.

    (Or use PPM, which does all that for you.)

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1006007]
Approved by tobyink
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2018-03-20 07:07 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (248 votes). Check out past polls.