#!/usr/bin/perl --
use strict;
use warnings;
use Getopt::Long qw/ GetOptions /;
use Data::Dump qw/ dd /;
Main( @ARGV );
exit( 0 );
sub Main {
my %opts;
GetOptions(
\%opts,
'carriers|c|C=s',
'num_tp|t|T|TP=i',
'Help|h|H',
'bs|b|B|BS|bs',
'version|v|V',
'legend|l|L=s',
'altitude|a|A=i',
'actdir|d|D=s',
);
dd( \%opts );
}
__END__
$ perl moresubs1184355-001.pl -c=1 -t=2 -v=3 -h=4 -l=5 -a=6 -d=7
Option v does not take an argument
Option h does not take an argument
{ actdir => 7, altitude => 6, carriers => 1, legend => 5, num_tp => 2 }
####
#!/usr/bin/perl --
use strict;
use warnings;
use Getopt::Long qw/ GetOptions /;
use Data::Dump qw/ dd /;
Main( @ARGV );
exit( 0 );
sub Main {
my %opts;
GetOptions(
\%opts,
'carriers|c|C=s',
'num_tp|t|T|TP=i',
'Help|h|H',
'bs|b|B|BS|bs',
'version|v|V',
'legend|l|L=s',
'altitude|a|A=i',
'actdir|d|D=s',
);
dd( \%opts );
WorkTheWorkbook( \%opts );
}
sub WorkTheWorkbook {
my( $optsRef ) = @_;
dd( $optsRef );
print "altitude=$optsRef->{altitude}\n";
use autodie qw/ open close /;
open my($fh), '<', '$optsRef->{altitude}'; # fake
return;
}
__END__
$ perl moresubs1184355-002.pl -c=1 -t=2 -v=3 -h=4 -l=5 -a=6 -d=7
Option v does not take an argument
Option h does not take an argument
{ actdir => 7, altitude => 6, carriers => 1, legend => 5, num_tp => 2 }
{ actdir => 7, altitude => 6, carriers => 1, legend => 5, num_tp => 2 }
altitude=6
Can't open '$optsRef->{altitude}' for reading: 'Invalid argument' at moresubs1184355-002.pl line 29
####
Beam_Hystersis( $workbook, $filename, $optsRef );
...
sub Beam_Hystersis {
my( $workbook, $filename , $optsRef ) = @_;
use autodie; ## stick this next to use strict so you dont have to keep repeating
open my($fh), '<', $filename;
...;
$worksheet->write( ... );
...;
}