HTML::Parser / Regexby MissPerl (Sexton)
|on May 26, 2017 at 20:30 UTC||Need Help??|
MissPerl has asked for the wisdom of the Perl Monks concerning the following question:
Hi fellow Perl Monks,
I am trying to get text/number in a html file then store them into a variable. I know that HTML::TableExtract or some other module might have easier way to do this. But for now, I want to learn and apply HTML::Parser and regex first.
This is part of my failed attempt perl script, it got errors like bareword found (might be runaway multi-line) and can't use global $1 in my. At the beginning of the script, it prompt user for input then store them into a variable. For now, I am writing the part for the script to be able to reads the $ca html file and find match. Then next part of the script will continue for the other states' html file.
Below are a few lines from two different html files.
And I've been trying to get the value into the variable, so that I could use them later. $one = -0.82 $two = -5.02 $three = 19
Apologize in advance for the fail attempt of perl script that I wrote. I could understand if it's too painful to watch. But kindly point out my mistake and guide me the correct way. Thank you so much.
P/S: You could say that I am a slow learner because after a few days of self-learning perl, I still could't quite pick up how this string-matching works. I'm using perl v5.8.8