| 1 | #!/usr/bin/env perl | ||||||||||
| 2 | |||||||||||
| 3 | 37 | ▶ | use Modern::Perl; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 37 | ▶ | use ZX81::Tape qw(dump_p); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 37 | ▶ | use Getopt::Std; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 37 | my $USAGE = "Usage: $0 [-o output_file.txt] input_file.p\n"; | |||||||||
| 8 | 37 | ▶ | getopts( 'o:', \my %opts ) or die $USAGE; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 9 | 37 | ▶ | @ARGV == 1 or die $USAGE; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 10 | 37 | my $input_file = shift @ARGV; | |||||||||
| 11 | |||||||||||
| 12 | 37 | ▶ | if ( $opts{o} ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | 37 | my $output_file = $opts{o}; | |||||||||
| 14 | 37 | dump_p( $input_file, $output_file ); | |||||||||
| 15 | } | ||||||||||
| 16 | else { | ||||||||||
| 17 | 0 | dump_p($input_file); | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | __END__ | ||||||||||