in reply to WWW-LEO, why is my code "crashing"

Your code is not "crashing", Perl just warns you about some events that you might not want. But if you look at your error message, you see two line numbers. One line is for WWW/LEO.pm - in line 218, a value is used that has not been initialized. The second line is for the INFO filehandle. It currently points to line number 370, likely because you have 370 vocables in your info file. If you change your code around a bit, Perl will tell you which word triggers these warnings:

Instead of

my @file = <INFO>; foreach my $entry (@file) { ... };
use
foreach my $entry (<INFO>) { ... };
Then, the second line number will tell you the number of the word triggering the problematic behaviour. Of course, you could also output each word before looking it up via WWW::LEO:

foreach my $entry (@file) { chomp $entry; warn "Looking up '$entry'"; ... };

Replies are listed 'Best First'.
Re^2: WWW-LEO, why is my code "crashing"
by metalfan (Novice) on Dec 29, 2005 at 20:34 UTC
    somehow the line numbers didn't changed with the new code?

      You don't show any new code, so I can't comment on why the numbers don't change. Most likely, you didn't implement any of my suggestions.

        ive used your first example:
        Instead of

        my @file = <INFO>; foreach my $entry (@file) { ... }; use foreach my $entry (<INFO>) { ... };
Re^2: WWW-LEO, why is my code "crashing"
by metalfan (Novice) on Dec 29, 2005 at 19:26 UTC
    its not crashing, okay...but something wired is happening, these are the first words from my vob list.
    sometimes the script can handle the input and sometimes not...
    "Abating", "Abdominal"," Unterleibs- [Präfix], Bauch, Hinterleibs, abdominal [ad +j.]" "Ability","Geistige oder körperliche Fähigkeit, Geschicklichkeit, nach + besten Kräften" "Ablative", "Abrupt", "Acquittance","Erfüllung, Verpflichtung, Begleichung" "Addiction", "Admit","1. to admit [v.] einlassen [v.], zugeben [v.], zugestehen +[v.], zulassen [v.] 2. to admit of [v.] zulassen [v.] 3. to admit t +o [v.] aufnehmen in [v.], eingestehen [v.], hereinlassen [v.], zuge +ben [v.]" "Adult","1. adult [n.] Erwachsene [m.,f.] 2. adult [adj.] erwach +sen [adj.]" "Advanced","erweitert [adj.], fortgeschritten [adj.], fortschrittlich +[adj.], vorgerückt [adj.], zukunftsweisend [adj.]" "Affairs", "Affection","Liebe, (Zu)Neigung, Gemütsbewegung -zustand, Stimmung, Er +krankung, leiden" "Afraid", "Allies", "Ancestor","Vorfahr, Ahnherr, Stammvater" "Angles", "Anticipation"," Erwartung [f.], Vorausnahme [f.], Vorwegnahme [f.]" "Anxious"," unruhig [adj.]" "Argued","1. to argue [v.] argumentieren [v.], auseinander setzen [a +usdr.], behaupten [v.], bereden [v.], bestreiten [v.], erörtern [v.] +,streiten (§ p.,pp.: stritt, gestritten) [v.], vorbringen [v.]" "Arise","Entstehen, entspringen, hervorgehen" "Arowse","Pret. Von arise" "Artefact", "Attenuated", "Augmentation", "Awfully"," furchtbar [adv.], schrecklich [adv.]" "Awkward"," eckig [adj.], heikel [adj.], linkisch [adj.], peinlich [a +dj.], tolpatschig [adj.], täppisch [adj.], umständlich [adj.], unang +enehm [adj.], unbeholfen [adj.], ungelenk [adj.], ungeschickt [adj.], + ungünstig [adj.], tapsig* [adj.]" "Baggage",