in reply to Re: Re: Re: Which loop should I use?
in thread Which loop should I use?

Thank you for the code rewrite and the interest you have in this problem. While running your code I was presented with 500 ISE:
syntax error at newparse.pl line 63, near "+}" Can't use global $1 in "my" at newparse.pl line 72, near "= $1" Can't use global $! in "my" at newparse.pl line 73, near "$number: $!" Can't use global $! in "my" at newparse.pl line 76, near "$number: $!"
And I cannot use your script for anything but reference because there are many things within your version that I don't understand (most of your script actually). Using HTML::Tree the code may not have been perfect but I understood all of what I was trying to do.

I will definitely keep this script and I will try to work out the bugs. Thanks!

Replies are listed 'Best First'.
Re:^5 Which loop should I use?
by tedrek (Pilgrim) on Aug 01, 2003 at 16:46 UTC

    The error you got was because one line got wrapped by PM, I've added a few line breaks so nothing wraps now. In your original code there was three things that jumped out at me. The first was a 'local $/;', you aren't doing anything with IO so that doesn't do anything. The second is your use of 'split "<br>",...', You are using that on the text only version which will not have any html in it so it is just assigning the text to $lines[0]. Also you split on "<br>" later which won't do anything because the original split would have gotten all of the <br>'s anyway. The third is your regex for getting $goodlines, it will only match against a string that hasn't been broken up into lines, which means your split has to fail for that regex to work. Anyway, hope you can get it to work, and if you have any questions feel free to ask.

    Tedrek