in reply to Re^3: regexp text parsing issue.
in thread regexp text parsing issue.

Can't do that. The application I am developing for is already mature and a rewrite is not possible. Isn't there anyone who has an idea on how to actually do this instead of suggestion a work around?

I can't change the format, I can't have third party modules needing to be installed by the user. That is what I am dealing with.

Replies are listed 'Best First'.
Re^5: regexp text parsing issue.
by Tanktalus (Canon) on Mar 19, 2005 at 03:00 UTC

    To be honest, if this were a problem I was facing in my job, I would be looking at the workarounds. I'm serious. There's a reason why so many people here are suggesting workarounds: the straight-forward HTML parsing is so painful that we wouldn't want to rewrite it. Even if you have to grab HTML::Parser and bundle it with your app, that's going to be so much easier and more reliable than regexp's... it'll be worth it.

      Ok you have sold me on HTML::Parser but how would I accomplish this with that module. I have read the docs on it and it seems unable to perform what I am trying to accomplish.
Re^5: regexp text parsing issue.
by jhourcle (Prior) on Mar 19, 2005 at 04:17 UTC

    You're being blinded by your goal. You need to be thinking about how to bypass your problems, not choosing an end goal, and focusing only on working towards it -- if you do, you'll miss the other paths that might come up along the way.

    Try this as a possible work around:

    1. Set up a CGI at a new URI.
    2. The new CGI proxies the connection to the old CGI, but reformats the output, to something that is easily parseable.

    So, you've solved the issue with the users not needing to install HTML::Parser, and you've not re-written the original CGI.