Here is the compilable code. I thought it would be easier to focus on the problem directly. Sorry about any inconvencience caused.
#! C:/programme/perl
use LWP::Simple;
use LWP::UserAgent;
use HTML::Stripper;
use warnings;
use strict;
our $stripper = HTML::Stripper->new( skip_cdata => 1, strip_ws => 1 );
our $ID;
our @ID=(161060, 160920, 160999, 160899);
our $count=1;
foreach $ID (@ID) {
my $content;
my $content_full;
my $url="http://europa.eu.int/prelex/detail_dossier_real.cfm?CL=en&Do
+sId="."$ID";
$content_full=" ";
$content_full=get($url);
$content=$stripper->strip_html($content_full);
our $i_type=index($content, " COM ");
our $d_type=substr($content, $i_type+1,3);
our $d_year=substr($content, $i_type+6,4);
our $d_number=substr($content, $i_type+12,3);
our $proposal="$d_type "."\($d_year\)"." $d_number";
print "Proposal\: $proposal \n";
open DB, ">> C:/programme/perl/test/prelex.dta"
or die "Problem: $!";
flock (DB, 2);
print DB "$proposal\n";
close DB;
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.