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

Is there a way to use perl to capture the current web page in an email? I'm trying to setup a report abuse link that would send an email of the offending web page to an administrator.

Replies are listed 'Best First'.
Re: Capture Current Web page in an email
by ww (Archbishop) on Mar 19, 2010 at 16:34 UTC

    Assuming what you really mean is "capture the page currently being viewed in a browser and attach the capture to an email...."

    1. Just send the URL -- the admin can ("will" is a different story) look at it without getting a mailbox jammed with pix of a website.
    2. but if that's not satisfactory...
      write a script to capture the page (LWP perhaps; you may find some profit in reading this at perl.com), write it to a file (or to memory if you choose to make your script monolithic) and use any of the standard modules (MIME:xxx; see search.cpan.org/perldoc?MIME::Lite) to attach it to an email.

    The question suggests, however, that you need to work on a fundamental subject: the role of modules in the Perl world.

      If you have the capability (ie if it's installed) you can use wget to download the whole page, store it somewhere on that disk, then record the file/path name to it in your email... I agree that #1 above is the best thing to do though. Your network admin might care about sending screenshots/screenscrapes, or whatever method you use. They could get big very quickly.

      I also agree, the right modules will probably get you 90% of the way there.

        Thank you all for your input. It has been very helpful.