Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^5: Perl Get issue

by Don Coyote (Monk)
on Nov 14, 2012 at 13:42 UTC ( #1003804=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Perl Get issue
in thread Perl Get issue

chomp(@array) will remove newlines from the end of each element within an array. If the newline is being placed at the start of the element you may need to preprocess the the code prior to the print. The '.' now matches newlines so you have to consider this when outputting code

If really problematic, please post a new thread with example code and output. You may mean the same row once printed out in html for all I can tell.


Comment on Re^5: Perl Get issue
Re^6: Perl Get issue
by petdance (Parson) on Nov 14, 2012 at 17:26 UTC
    The problem is that regexes are not a robust way to parse HTML. You may be parsing a given page correctly, but if that page ever changes, your regexes will break.

    See http://htmlparsing.com/perl.html for some examples of how to do it right, and http://htmlparsing.com/regexes.html gives more details about why regexes are a bad idea.

    xoxo,
    Andy

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1003804]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (12)
As of 2014-12-18 22:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (67 votes), past polls