#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    9
    Rep Power
    0
    I'm not familiar w/ perl, does anyone know how to convert this php code into perl ?

    <?
    //put file in array
    $fcontents = file ('http://www.domain.com/file_to_print.php3');
    //print each lines
    while ( list( $line_num, $line ) = each( $fcontents ) ) {
    $val = stripslashes( $line );
    echo $val;
    }
    ?>

    I'm trying to read & print output from a file that is located on another site in order to share news between my domains.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    60
    Rep Power
    15
    I found this php script linked at HotScripts (I think). There isn't much more info on the site, but this code works well, if you don't know Perl, this might be a better option for you.

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre><?
    /* Start Quoter Code

    'Quoter' Script By: JbA
    Web Address: http://www.4cm.com/
    Email Address: support@4cm.com

    Use of this code is allowed, free, and offered
    as long as you email me with the URL of the page
    your using it on!

    It is offered 'AS IS', and I take no claim (responsibility!)
    that it will work, or that it won't screw up your system!
    */
    $file = fopen("http://www.4cm.com", "r");
    $rf = fread($file, 20000);
    $grab = eregi("BEFORE CODE(.*)AFTER CODE";
    $printing[1] = str_replace("#cccc99", "white", $printing[1]);
    fclose($file);
    echo $printing[1];
    #
    # Please Be Aware That Most Web Sites Consider It Against The Law
    # To "Grab" information/data from their Web Site. I (www.4cm.com)
    # am not responsible for getting permission either! - JbA
    # These four (4) lines maybe removed without breach of Rights Of Use!
    ?>[/code]
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    9
    Rep Power
    0
    thanx for for taking the time to answer, someone suggested me to use something like that (works fine)

    use LWP::UserAgent;
    my $ua = LWP::UserAgent->new;
    $ua->agent('SomeUAString' . $ua->agent);
    my $req = HTTP::Request->new( GET => 'http://www.domain.com/somefile.php3' );
    my $res = $ua->request($req);
    print $res->content;

Similar Threads

  1. Replies: 2
    Last Post: February 9th, 2004, 01:22 PM
  2. Perl to PHP converter
    By superprogrammer in forum Project Help Wanted
    Replies: 0
    Last Post: February 7th, 2004, 11:36 AM
  3. Converting DOC files to PDF files using PHP
    By necrophagous in forum PHP Development
    Replies: 3
    Last Post: February 6th, 2004, 12:36 PM
  4. Pass Perl variable through PHP to browser?
    By dvd in forum Perl Programming
    Replies: 6
    Last Post: January 18th, 2004, 01:37 PM
  5. I've got PHP and I need Perl!
    By Jaydan_W in forum Perl Programming
    Replies: 4
    Last Post: January 17th, 2004, 01:00 AM

IMN logo majestic logo threadwatch logo seochat tools logo