this is the code i wrote to fetch some website. Although theres nothing wrong with the code it gives an error "Use of uninitialized value in print at Perl-1.pl line 25, <MANFWORKFILE> li
ne 298."
this is the code.... where have i gone wrong?
#!/usr/bin/perl -w
use strict;
use LWP::Simple;
my @manfCode; my @next_lines; my $manf;
my $counter = 0; open (MANFWORKFILE,
'C:\MyWork\OptionsDB\Belkin\Wizards\PdaConfig\manf_junk.txt'); while (
+defined($_
= <MANFWORKFILE>)){
if (/PDAConfigListModels\.asp/){
@manfCode = split(/manufacturerID\=/, $_); $manfCode[1] =~ s/\
+"\>//g;
push @next_lines, scalar(<MANFWORKFILE>) if /PDAConfigListMode
+ls\.asp/;
$next_lines[$counter] =~ s/^[\s]+//;
print $manfCode[1].$next_lines[$counter];
$manfCode[1] =~ s/\s+//; $counter ++;
my $response =
get("http://web.belkin.com/config/pda/PDAConfigListModels.asp?
+sid=167240621&manufacturerID=$manfCode[1]");
open (INDEXFILE,
'>C:\MyWork\OptionsDB\Belkin\Wizards\PdaConfig\model_junk.txt'
+) or die
("Can't open out File: $!\n"); print INDEXFILE $response; clos
+e
INDEXFILE;
}
} close MANFWORKFILE;
20040818 Edit by ysth: change title from cookie ERROR?????
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.