>#!/usr/bin/perl
>
>use strict;
>use warnings;
>
>my $file = 'in.txt';
>open FH, $file or die qq(Cannot open "$file": $!);
>
>my @replacements;
>while ( <FH> ) {
>   next unless m/\|/;
>
>   # limit split to just 2 resulting arguments.
>   push @replacements, [ split /\|/, $_, 2 ];
>}
>
>$file = 'in.blah';
>open IN, $file or die qq(Cannot open "$file": $!);
>
>$file = 'testo_new.txt';
>open OUT, ">>$file" or die qq(Cannot open "$file": $!);
>
>while ( my $line = <IN> ) {
>   foreach my $replacement ( @replacements ) {
>       $line =~ s/\Q$replacement->[0]\E/$replacement->[1]/;
>   }
>   print OUT $line;
>}
>
>close IN;
>close OUT;

the scipt doesn't work, the result is an un/understandable list of
pipes and uncompiled strings, and $file = 'in.blah'; can't be
compiled. i'm trying to rebuild the script using your suggestions.
byez
Alex

On Tue, 1 Mar 2005 00:19:52 +0100, Web Solving <[EMAIL PROTECTED]> wrote:
> very thanks, tomorrow morning i'll test it and i'll tell you if it
> works (i'm sure about it)! really thanks for helping me!
> 
> Alexander
> 
> --
> WebSolvingJaa: informatica per il web e l'azienda.
> http://websolvingjaa.altervista.org/
> 


-- 
WebSolvingJaa: informatica per il web e l'azienda.
http://websolvingjaa.altervista.org/

-- 
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