in reply to formatting text

Perhaps this will do what you require:

open IN, '<', 'test.txt' or die "Can't open 'test.txt' $!"; open OUT, '>', 'test.out' or die "Can't open 'test.out' $!"; while ( <IN> ) { next unless /\S/; tr/ \t/ /s; print OUT; # Updated -- thanks Narveson } close IN; close OUT;

Replies are listed 'Best First'.
Re^2: formatting text
by Narveson (Chaplain) on Jun 20, 2008 at 04:00 UTC

    Revised I set up test.txt and ran the first version of this code and got no output. Added use warnings and posted the warning messages here with no comment. Sorry if that came across as unfriendly.