in reply to It works!
in thread Input Record Separator WON'T WORK!

Using the IRS fails in the following situations:

<student><!-- </student> -->...</student>
<student>...</student >
<student />

And possibly more. (charset? entities?)

Also, it fails miserably (i.e. reads the entire file into memory) at detecting errors.

If you really do wish to reinvent the wheel, time to learn and start using something else.

Replies are listed 'Best First'.
Re^2: It works!
by stalepretzel (Initiate) on Jan 25, 2008 at 03:49 UTC
    This is still in the earliest stage... Obiously, it does absolutely nothing right now. But it will! It will be changed immensely. No worries. ... I don't understand what you mean by that last line....? what do you mean "time to learn and use something else?" Learn... what? Use "something else" as opposed to.... what am I using now? ...?

      He means that if you are going to parse an XML file, use an XML module from CPAN because it already handles all the funky cases you will end up needing to handle and that if you want to reinvent the wheel (re-code and debug all the parts already done in a module) then you'll have to learn some new skills because IRS isn't going to cut it. ;)

      You mentioned wanting to be a good programmer before using modules, in Perl, using modules is a big part of being a good programmer.


      ___________
      Eric Hodges
      The input would need to be processed in order (char by char, then token by token). Using a parser generator (e.g. Parse::RecDescent and a good book on parsing) will help a lot, while still leaving much to learn.