in reply to Parse HTML into multidimensional array

You already have an RSS feed of the stuff you want, why not use something like XML::RSS to parse it easily and reliably?

As for your aversion of modules: don't. Modules are part of why Perl is so useful. You don't have to understand all of what a module does, just use one to get your work done.
Then, if you have time left, you can peruse the source code.

-Thomas
"Excuse me for butting in, but I'm interrupt-driven..."
  • Comment on Re: Parse HTML into multidimensional array

Replies are listed 'Best First'.
Re^2: Parse HTML into multidimensional array
by mazdajai (Novice) on Jul 16, 2015 at 22:29 UTC
    Thanks everyone for the inputs and their comments. This is what I have so far, with a help of my friend and I will definitely check out XML::RSS.
    my $Feeds = [ 'http://newyork.craigslist.org/search/fua?query=window%20fan&&form +at=rss', 'http://newyork.craigslist.org/search/fua?sort=rel&max_price=50&qu +ery=wire+shelf&format=rss' ]; my $Results; for my $Index (0 .. $#$Feeds) { $_ = get $Feeds->[$Index]; s/\n//g; $Results->{$Index} = { 'Query' => (/<title>craigslist newyork \| furniture search "(. ++?)"<\/title>/i)[0], 'Title' => [/<title><!\[CDATA\[(.+?)\]\]><\/title>/gi], 'Link' => [/<link>(http:.+?)<\/link>/gi], 'Description' => [/<description><!\[CDATA\[(.+?)\]\]><\/descri +ption>/gi] }; }