in reply to Re: Converting a source code
in thread Converting a source code
Thanks a lot monks! Been a big help! Combining all your comments...
Tried the array pairs GrandFather but i got a blank target file... I wonder why.... hmm.... <;use strict; use warnings; open "SOURCEFILE", '<', "source.cbl" or die "Can't open: $!"; open "TARGETFILE", '>', "source.ada" or die "Can't open: $!"; while (defined (my $line = <SOURCEFILE>)) { if ($line =~ s/WORKING -STORAGE SECTION\./declare/) { print TARGETFILE $line; } elsif ($line =~ s/PROGRAM -BEGIN\./begin/) { print TARGETFILE $line; } elsif ($line =~ s/DISPLAY/PUT/) { print TARGETFILE $line; } elsif ($line =~ s/ACCEPT/GET/) { print TARGETFILE $line; } elsif ($line =~ s/PROGRAM -DONE\./END;/) { print TARGETFILE $line; } } close SOURCEFILE or die "Can't close: $!"; close TARGETFILE or die "Can't close: $!";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Converting a source code
by GrandFather (Saint) on Aug 21, 2006 at 20:48 UTC | |
by oblate kramrdc (Acolyte) on Aug 24, 2006 at 22:00 UTC | |
|
Re^3: Converting a source code
by swampyankee (Parson) on Aug 21, 2006 at 22:04 UTC | |
by rvosa (Curate) on Aug 22, 2006 at 01:10 UTC | |
by oblate kramrdc (Acolyte) on Aug 24, 2006 at 21:57 UTC | |
|
Re^3: Converting a source code
by graff (Chancellor) on Aug 22, 2006 at 03:33 UTC | |
by oblate kramrdc (Acolyte) on Aug 24, 2006 at 21:56 UTC |