home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Internet / WWW / Perl_WWW_Utilities / total / links / changelinks.pl next >
Encoding:
Perl Script  |  1995-10-15  |  404 b   |  23 lines

  1. #! /usr/local/bin/perl
  2.  
  3. $file = "/home/~yourname/public_html/links/links.html";
  4.  
  5. # Begin the Editing of the Links File
  6. open (FIL,"$file");
  7. @LINES=<FIL>;
  8. close(FIL);
  9. $SIZE=@LINES;
  10.  
  11. # Open Link File to Output
  12. open (MSG,">$file");
  13.  
  14. for ($i=0;$i<=$SIZE;$i++) {
  15.    $_=$LINES[$i];
  16.   if (/<li><a href=(.*)>(.*)<\/a>/) {
  17.     print MSG "<li><a href=\"$1\">$2</a>\n";
  18.   }
  19.    else { print MSG $_; }
  20. }
  21. close (MSG);
  22.  
  23.