I have a short career in Perl, compared to everyone else around here. In my time I have noticed that one of the most useful and convenient things is to grab stuff off webpages and have a Perl script print only the information you want neatly in an understandable form: Weather, stocks, lottery, news, etc.
I know that the easiest way to get the whole page is through the
LWP::Simple module with the
get method.
I have a problem though. Whenever I try to make a script that fetches something off the web it either returns undefined or it does nothing like I want it to. So now I ask you:
What suggestions do you have for me to:
- Avoid regular expressions as much as possible
- Use only the data you want and trash the other stuff
- Make it flexable so that it will still get the data you want even though the data changes.
I think that this information could really widen the usage of Perl because I haven't seen much writing on it and its so useful and varied.
Oh yes, please include little snippets to help me understand a little, I'm a little bullheaded at times. :-) Thank you all!
Wanna be perl hacker.
Dave AKA damian
I encourage you to email me
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.