wfsp has asked for the wisdom of the Perl Monks concerning the following question:

winXP, activestate 5.8

Is anyone able to reproduce the following please?

Uncommenting the use Net::FTP line causes XP to crash ("Perl command line interpreter has encountered a problem..."). Even with the eval.

Further, removing the data starting "kosovar" and it doesn't.

Is there anything I'm missing here?

#!/bin/perl5 use strict; use warnings; use DBM::Deep; #use Net::FTP; my $words_all = { expletive => [1060], agong => [1542], measles => [qw(1459 415 1497)], proven => [qw(833 119 208)], sexta => [qw(517)], kosovar => [qw(33 35 28 44)], }; my %pack; while (my ($word, $url_list) = each %{$words_all}){ my $url_list_packed = pack 'v*', @{$url_list}; $pack{$word} = $url_list_packed; } my $file = 'data/word.db'; unlink $file if -e $file; my $db = DBM::Deep->new(file => $file); eval{ $db->import(\%pack); }; die $@ if $@;

Replies are listed 'Best First'.
Re: A Net::FTP and DBM::Deep clash
by puploki (Hermit) on Sep 26, 2005 at 12:16 UTC

    Win XP Pro, ActivePerl 5.8.7 - all runs without crashing for me, including when I uncomment the use of the Net::FTP module.

    HTH,
    --Loki

Re: A Net::FTP and DBM::Deep clash
by talexb (Chancellor) on Sep 26, 2005 at 12:28 UTC

    The only obvious thing that I can suggest is that Net::FTP does some initialization that WinXP doesn't like. How about if you just try using that module and printing "It works!" in a test file all by itself.

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

      Thanks for your comment.

      I use Net::FTP regularly without any problems.

      In fact I had one script creating a db and another ftping it. It was only when I combined the scripts that everything went belly up. Because I had not had any problems it took a long time to realise what was causing it.

      puploki's efforts indicate it is something to do with my setup.

        I further tracked the error down to the value 33 in the kosovar array. Changing this to any other value cures the problem. I conclude that DBM::Deep (0.94) had some bug that manifest itself when a '!' appears in the data. Maybe this has been fixed in later versions?


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
        "Science is about questioning the status quo. Questioning authority".
        The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.

        I reproduced your results exactly using XP/5.8.4/D::D 0.94/N::FTP 2.72.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
        "Science is about questioning the status quo. Questioning authority".
        The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.