perl doubt

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sandhya2006
    New Member
    • Dec 2006
    • 11

    perl doubt

    Hi friends
    Iam new to perl Can anyone help me. How to print many html files into one text file using perl,now i can able to print one html file into one text file.
  • miller
    Recognized Expert Top Contributor
    • Oct 2006
    • 1086

    #2
    Originally posted by sandhya2006
    Hi friends
    Iam new to perl Can anyone help me. How to print many html files into one text file using perl,now i can able to print one html file into one text file.
    Great, you have doubt. Why should we care?

    If you have a real question, post it along with the code that you are working.

    Thanks.

    Comment

    • sandhya2006
      New Member
      • Dec 2006
      • 11

      #3
      This is my code ........first this will print the location of the file into one text and then its content wll print on the another text.but here only one html file will b printed in one text file,i want to know how is possible to display many html file content into one text file.


      #!usr/bin/perl
      $var="D:/perl.com/";
      opendir(str,$va r);
      @file=readdir(s tr);
      close(str);
      while ($li=<@file>)
      {

      foreach($li)
      {
      open(Tr,">conte nt.txt");

      for($a=2;$a<126 ;$a++)
      {

      print Tr $var,@file[$a],"\n";

      }

      }

      }
      sub first()

      {
      # $_=shift;
      undef $/;

      #open(file,"abo ut.html");


      $_=<file>;
      $_ =~ s/\<[^>]+\>//gm;
      $_=~ s/^\s+//gm ;
      $_=~ s/&nbsp\;|&quo t//gm ;
      $_ =~ s/\<\>//g;
      open(t,">ns.txt ");
      print t;
      print;
      }



      if(open(file,"a bout.html")){ first(); }















      ;

      Comment

      Working...