Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Does anyone know if its possible to have a perl program to grab the source code html result of a perl program after it has been printed to the browser?

Replies are listed 'Best First'.
Re: View Source
by Mr. Muskrat (Canon) on Dec 27, 2002 at 21:22 UTC

    It's possible to have a perl program that grabs the html generated by a CGI script by acting as a browser.

    Look at the docs for the LWP series of modules.

Re: (nrd) View Source
by newrisedesigns (Curate) on Dec 28, 2002 at 06:10 UTC

    Perhaps you could elaborate on why you specifically need the browser to interpret the HTML instead of using LWP to get it. Do you need to analyze Javascript or something else dynamic?

    Also, why don't you sign up and stay a while?

    John J Reiser
    newrisedesigns.com

Re: View Source
by ehdonhon (Curate) on Dec 27, 2002 at 21:52 UTC

    I don't know of any browsers that support that kind of thing in a totally automated way. Of course, you could always go to "File" and select "Save As...", then reading the source in with perl would be very simple.