in reply to Chomp not working
# process the input and be done with it... die"error $!\n" unless open hanr,"splitin.pl"; my @lines = <hanr>; close hanr; my $r = ''; # its easier to debug when you have a scalar you can print + later, rather than printing line by line... for my $line ( @lines ) { # odd since $outcome is undef .. ? next unless $line =~ /^\$outcome /x; $line =~ s/.{9,9}(.+)../$1/; # get the middle chars $r .= $line; #append # print hanw "$mess , \n" # why chomp then add \n back in? Just l +eave it there....; } # process the output here die $! unless open hanw, ">output.csv"; print hanw $r; close hanw;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Chomp not working
by sandy105 (Scribe) on Sep 25, 2014 at 10:13 UTC |