in reply to Re^2: WWW-LEO, why is my code "crashing"
in thread WWW-LEO, why is my code "crashing"
the input file:#!/usr/bin/perl use warnings; use strict; use diagnostics; use WWW::LEO; use Data::Dumper; open(INFO, "< /home/metalfan/todo/dictionaries/Vokabeln\ -\ absolut +ion\ gap.csv.test") || die("can't open datafile: $!"); #my @file=<INFO>; #for my $entry (@file) foreach my $entry (<INFO>) #for my $entry ($file[10]..$file[15]) { my $n=0; if ($entry =~ m/"(.+)",\s/x) { if ($entry =~ m/Baggage/) { exit; } my $vokabel=$1; #print "$1\n"; my $leo = WWW::LEO->new; #$leo->query("@ARGV"); $leo->query("$vokabel"); if ($leo->num_results) { my $i; foreach my $resultpair (@{$leo->en_de}) { printf "%3d: %-40s %s\n", ++$i, @$resultpair; } } else { print "Sorry, your query for ’%s’gave no results.\n", $leo +->query; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: WWW-LEO, why is my code "crashing"
by metalfan (Novice) on Jan 09, 2006 at 14:23 UTC |