Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Last time I did something like that, I just used a shell script wrapped around my perl scraper, and did the upload with scp:

#!/bin/bash # scrape targets and load files to server . $HOME/.bash_profile cd $HOME/MyBot FILENAME=`date "+scrapefiles/scrapetarget%C%y%m%d.txt"` perl MyRobot.pl > $FILENAME scp $FILENAME myusername@mydomain.com:templistings

"templistings" is the remote directory I load my scrapings into, where a cron job looks for them periodically and loads them into a mysql database. In your case you would just specify the directory where you want your file to go in your web structure and just write it as a .html file. You could delete the local copy after, but I keep mine in an archive.

An alternative would be to use something like Net::SCP to do the whole thing from within your perl program. You could probably also have your program ssh in to server2 (with Net::SSH::Perl) and write the file directly without making a local copy, but that seems a little more fragile to me.

If the problem is that you need it to run from inside a PHP page, that's a PHP problem, and there's probably better places to ask (though some here might be able to help).


In reply to Re: Simple Perl print() output redirect to html/webpage. by bitingduck
in thread Simple Perl print() output redirect to html/webpage. by hmb104

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others imbibing at the Monastery: (13)
    As of 2014-09-18 14:38 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (116 votes), past polls