other problems with this damn' script.
i wrote it again adding some feature i find in the net, now it looks like it:

open(INFILE,"lista.txt") || die "Cant read lista.txt. Reason: $!"; 
# maybe the error is in this file.it is like:
# word|<\a href="http:\/\/www\.word.com>word<\/\a>
# other word|<\a href="http:\/\/www\.other-word.com>other word<\/\a>

open(READIT,"testo.txt") || die "Cant read testo.txt. Reason: $!";
# it's a 2 line text without strange characters, it's about 100 words. 

open(WRITEIT,">>testo_new.txt") || die "Cant write testo_new.txt. Reason: $!"; 

 while (<READIT> || <INFILE>) { 

   $riga = $_;
   my ($search, $replace) = split /|/; 
   $riga =~ s/$search/$replace/; 
   print WRITEIT "$riga\n"; 

 } 
close(WRITEIT); 
close(READIT); 
close(INFILE);

as result of this script i've a blank testo_new.txt file .
anyone can help me?

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to