script/basic2pl.pl untested

filter: Statementstmt 0.0% 0 / 18 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 30 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/local/bin/perl -w
2  
3 # A BASIC interpreter.
4 #
5 # Reads in file $ARGV[0] or "program.bas" by default and runs it as a BASIC
6 # program.
7 use strict;
8 use Language::Basic;
9  
10 my $Default_Filename = "program.bas";
11 die "Usage: $0 [filename] - translates BASIC program filename into Perl\n$Default_Filename by default\n" unless -e "$Default_Filename" or @ARGV;
12  
13 my $Program = new Language::Basic::Program;
14 my $infile = shift || "$Default_Filename";
15  
16 # Read the lines from a file
17 warn("Reading program... \n");
18 $Program->input($infile);
19  
20 # Parse the lines
21 warn ("Parsing program... \n");
22 $Program->parse;
23  
24 # Implement the program
25 warn("Beginning to output the program as perl...\n");
26 $Program->output_perl;
27  
28 warn "Done translating the program.\n";
29 exit(0);