Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Compilation failed in require

by Khen1950fx (Canon)
on Aug 12, 2013 at 10:22 UTC ( #1049099=note: print w/ replies, xml ) Need Help??


in reply to Compilation failed in require

First, Wiktionary::Parser has few dependencies that need to updated before you install the parser. In a nutshell:

#!/usr/bin/perl use strict; use warnings; use CPAN; my (@mods) = qw( File::Path Text::Unidecode JSON WWW::RobotRules HTTP::Cookies Net::FTP Net::HTTP IO::Socket HTTP::Daemon Digest::MD5 HTML::Tagset XSLoader HTML::Entities HTTP::Negotiate File::Listing Time::Local HTTP::Date Bundle::Compress::Zlib File::Temp Exporter Scalar::Util IO::HTML IO::Uncompress::Inflate HTTP::Status Encode Encode::Locale LWP::MediaTypes Test MIME::Base64 URI::EScape LWP::UserAgent MediaWiki::API Carp Spiffy ExtUtils::MakeMaker Filter::Util::Call Test::More Test::Base Test::CheckManifest Carp::Always Locale::Codes Wiktionary::Parser ); foreach my $mod (@mods) { CPAN::Shell->install($mod); }
Second, don't forget to use a dumper. I used Data::Dumper::Concise. Using your script, I use derived_terms and synonyms:
#!/usr/local/bin/perl -l use strict; use warnings; use Wiktionary::Parser; use Data::Dumper::Concise; my $parser = Wiktionary::Parser->new(); my $document = $parser->get_document( title => 'bunny' ); my $derived_words = $document->get_derived_terms(); my $synonyms = $document->get_synonyms(); print Dumper( $derived_words, $synonyms );


Comment on Re: Compilation failed in require
Select or Download Code
Re^2: Compilation failed in require
by BrowserUk (Pope) on Aug 12, 2013 at 10:39 UTC
    First, Wiktionary::Parser has few dependencies that need to updated before you install the parser.

    First, when you "installed Wiktionary::Parser on a Windows7 64bit operating system through ppm", PPM should have resolved and installed all dependencies when it was built on the PPM server (by ActiveState or whomever runs the PPM server).


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re^2: Compilation failed in require
by marto (Chancellor) on Aug 12, 2013 at 10:47 UTC

    OP used PPM, prerequsites are installed via PPM. Why have you scripted a cpan install when running cpan Wiktionary::Parser from the command line will do the same thing?

    Also note that OP said he was on Windows 7 64 bit, if they're using 64 bit ActiveState Perl no C compiler or build tools are installed by default, and aren't available on the 64bit platform from PPM. So without them manualling installing all this your suggestion of a cpan installation may fail.

    Update: Added link. Slight rewording for clarity

Re^2: Compilation failed in require
by Dr Manhattan (Beadle) on Aug 12, 2013 at 13:32 UTC

    Hi

    After installing all of Wiktionary::Parser dependencies, I do not get the error message as before, so it seems to have worked.

    However when I try to run the script that you posted (I had a look at Wiktionary::Parser documentation and it looks correct), I get a new error message- 'Can't call method "get_derived_terms" on an undefined value at \some\dir\script.pl line 12'. Any ideas?

    Thank you for the help in my previous post, much appreciated

      The documentation is incorrect. You should have gotten this output:
      { en => [ "angst bunny", "badge bunny", "bunny girl", "bunny rabbit", "cuddle bunny", "dust bunny", "Easter Bunny", "gym bunny", "snuggle bunny", "that's the bunny", "bunny wunny", "snow bunny" ] } { en => { language => "English", sense => { "easy, unchallenging, of a slope" => [ "nursery" ], "resembling a bun" => [ "bunlike" ] } } }
      You'll have to improvise:)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1049099]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2014-09-20 03:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (152 votes), past polls