in reply to Re^2: Converting a source code
in thread Converting a source code

I hope the previous replies have solved the immediate problem for you, and you are getting stuff stored into your target file. Just a couple more comments about the code you posted: If you actually want the output file to have the same number of lines as the input file (with some lines being edited), it's pretty short and simple:
use strict; use warnings; my $inp = "source.cbl"; my $out = "source.ada"; open INP, '<', $inp or die "Can't open $inp: $!"; open OUT, '>', $out or die "Can't open $out: $!"; while (<INP>) { s/WORKING -STORAGE SECTION\./declare/; s/PROGRAM -BEGIN\./begin/; s/DISPLAY/PUT/; s/ACCEPT/GET/; s/PROGRAM -DONE\./END;/; print OUT; } close INP; # no worries for closing input file close OUT or die "Can't close $out: $!";

Replies are listed 'Best First'.
Re^4: Converting a source code
by oblate kramrdc (Acolyte) on Aug 24, 2006 at 21:56 UTC

    1.Yes
    2. Oh... that was short...

    Tnx that was simpler...