You probably want something like this:
open FILE2, '>', 'file2' or die "Cannot open 'file2' $!"; open MYINPUTFILE, '<', 'file' or die "Cannot open 'file' $!"; while ( my $line = <MYINPUTFILE> ) { chomp $line; print FILE2 "$line\n", "you need to do this\n"; } unless ( $. ) { print FILE2 "There is nothing to do\n"; }
In reply to Re: if/while/else problem
by jwkrahn
in thread if/while/else problem
by ddrew78
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |