Thanks to all who provided information. I had a feeling it was fairly
straightforward. I normally do use the 'use strict;', but I don't use the
-w. I have noticed that even lwp-rget generates warnings.
Quite right about that chomp as well.
--HAPS
-----Original Message-----
From: Kingpin
To: [EMAIL PROTECTED]
Sent: 2/9/00 5:01 PM
Subject: Re: script
> #!/usr/local/bin/perl
You forgot -w
>
You forgot use strict;
> $INFILE="dog2.txt";
> open(FILE,$INFILE);
You forgot to check for error
> while ($LINE=<FILE>)
> {
> chomp($LINE);
Are you sure you want to chomp? If the file contains
"this\nis\na\ntest" then $TEXT will contain "thisisatest".
> $TEXT .= $LINE;
> }
> close(FILE);
>
> {
> package MyParser;
You forgot use strict;
> use base qw(HTML::Parser);
> sub text
> {
> $text = $_[1];
> $alltext .= $text;
This is referring to variable $alltext in package MyParser, i.e.
$MyParser::alltext
> # print "$text\n";
> }
> }
>
> MyParser->new->parse($TEXT);
> print $alltext;
This is referring to variable $alltext in package main, i.e. $::alltext
>
> --HAPS
>
--
- - Martin "Kingpin" Thurn [EMAIL PROTECTED]
Research Software Engineer (703) 793-3700 x2651
The Information Refinery http://tir.tasc.com
TASC, Inc. http://www.tasc.com
I don't know how we're going to get out of this one. -- Han, The Empire
Strikes Back