Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Parsing issues

by NetWallah (Abbot)
on Nov 16, 2012 at 05:23 UTC ( #1004125=note: print w/replies, xml ) Need Help??

in reply to Parsing issues

The code below may give you some hints on how to process your data:
use strict; use warnings; my @differenthtml; $/="htmlpagemark"; while (<DATA>){ chomp; next if $_ eq "htmlpagemark"; next unless length($_) > 0; push @differenthtml, $_; } for my $item (0..$#differenthtml){ print "===Item $item ==\n$differenthtml[$item]\n" } __DATA__ htmlpagemark #/q/hp?s=%5EDJI&d=10&e=8&f=20 +12&g=d&a=0&b=2&c=199 +2&z=66&y=5214 # <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" #"http://www.w3.o +rg/TR/html4/strict.dtd"> # It also consists of a lot of more text before the next #"h t m l p a + g e m a r k" htmlpagemark http://another/URL More text #sorry if this question reveals to be noobish and simple #but i have n +o idea how to solve this issue + the= #contents of a read text file END

             "By three methods we may learn wisdom: First, by reflection, which is noblest; Second, by imitation, which is easiest; and third by experience, which is the bitterest."           -Confucius

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1004125]
[MidLifeXis]: OHHHH. Mea culpa - I read that as coderef (facepalm)
[stevieb]: mlx: That's easy to have done in that context. For those who don't know, it converts itself into the current sub name, much like __PACKAGE__ translates into the current package name (or class)
[LanX]: ref! not name
[marioroy]: Hi all, am looking up __SUB__. Interesting.

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (14)
As of 2017-05-24 17:36 GMT
Find Nodes?
    Voting Booth?