Banner rotator in perl

Discussion in 'Programming' started by carl_in_florida, Nov 28, 2006.

  1. #1
    I am using this banner rotator in a php file:

    <?php
          $fcontents = join ("", file ("http://domain.com/ads.txt"));
          $s_con = split("~",$fcontents);
          $banner_no = rand(0,(count($s_con)-1));
          echo $s_con[$banner_no];
          ?>
    Code (markup):
    and have a txt file that has the ads seperated by a ~

    Is it possible to pull this same txt file with a perl script? I would like just one txt file for the site.

    Thanks
     
    carl_in_florida, Nov 28, 2006 IP
  2. vid

    vid Peon

    Messages:
    209
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    vid, Nov 29, 2006 IP
  3. weknowtheworld

    weknowtheworld Guest

    Messages:
    306
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I'm afraid you cannot use this script in PERL...
    PERL supports other language syntaxes but not PHP...
     
    weknowtheworld, Nov 30, 2006 IP
  4. carl_in_florida

    carl_in_florida Active Member

    Messages:
    1,066
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    90
    #4
    carl_in_florida, Nov 30, 2006 IP
  5. carl_in_florida

    carl_in_florida Active Member

    Messages:
    1,066
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    90
    #5
    carl_in_florida, Dec 1, 2006 IP