in reply to Re: Parse HTML into multidimensional array
in thread Parse HTML into multidimensional array

Looking at the source html, do you think it is impossible to pull the content into correct index? The purpose to achieve this without HTML::treebuilder so I can learn Perl without relying modules. I know it sounds silly but a lot time I won't understand the background using module.
  • Comment on Re^2: Parse HTML into multidimensional array

Replies are listed 'Best First'.
Re^3: Parse HTML into multidimensional array
by tangent (Parson) on Jul 14, 2015 at 22:01 UTC
    so I can learn Perl without relying [on] modules
    I would suggest that learning how to use HTML::TreeBuilder and in particular HTML::TreeBuilder::XPath would be a far more fruitful experience than entangling yourself in regular expressions. Learning powerful and robust modules will allow you to do more with Perl, not less.
Re^3: Parse HTML into multidimensional array
by GotToBTru (Prior) on Jul 15, 2015 at 14:07 UTC

    Impossible? Absolutely not, and easier with Perl than with any other language. But .. that's not saying much. I can sympathize with the desire to really learn Perl, but it will do you good to start to recognize that learning to use CPAN is part of learning to use Perl.

    If you're insistent on using regexes, start with the full html returned by your get command, and build the regex incrementally. A site like this can help you with that. And good luck! You can post questions here if you get stuck, but be prepared to hear "why aren't you using a module for this?" every time!

    Dum Spiro Spero