Link to home
Start Free TrialLog in
Avatar of bostoncybertech
bostoncybertech

asked on

Converting short perl script to php

For a perl script I made a while ago for a highcore table for games, I would like to convert to PHP to hold a database of web addresses for an entirely seperate purpose, but it's still among the same lines. I just changed some text down below from highscore to address.  I'm just curious how I'm going to change a lot of the code.  For instance, chomp and recalling a database from a text file.

#!perl
print "Expires: -1\n";
print "Content-type: text/html\n\n";
$filename = "addresses.txt";
open(DATABASE, $filename);
@addresses = <DATABASE>;
close DATABASE;
print "addresses=";
foreach (@addresses){
      @address_entry = split('-',$_);
      chomp @address_entry[0];
      chomp @address_entry[1];
      print ++$couner . ". ";
      printf "%-9s", @address_entry[1];
      printf "%9i\r", @address_entry[0];
}
exit;




Thanks.
ASKER CERTIFIED SOLUTION
Avatar of VoteyDisciple
VoteyDisciple

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bostoncybertech
bostoncybertech

ASKER

The dash will seperate the numbers from the words.  It used to hold the score and the persons name.  The "score" numbers eventually will not be usefull, but the list numbers may.  The "names" will be useful because they'll contain addresses instead.  I just have to figure out how a flash movie is going to read from a list, and figure out which address in the list to play, and to write to the list.  That all comes later though..