Astro-satpass
view release on metacpan or search on metacpan
217218219220221222223224225226227228229230231232233234235236237
local_strftime(
$opt
{time_format},
$time
);
}
# load_file( $file_name );
# Load the contents of a file.
sub
load_file {
my
(
$fn
) =
@_
;
my
$fh
;
open
$fh
,
'<'
,
$fn
## no critic (RequireBriefOpen)
or
die
"Unable to open $fn: $!\n"
;
local
@ARGV
;
local
$_
=
undef
;
while
( <
$fh
> ) {
s/ \s+ \z //smx;
''
eq
$_
and
next
;
s/ \A \s+ //smx;
'#'
eq
substr
$_
, 0, 1 and
next
;
push
@ARGV
,
$_
;
}
close
$fh
;
GetOptions( \
%opt
,
@lgl_opt
)
inc/My/Module/Satpass.pm view on Meta::CPAN
7677787980818283848586878889909192939495
plan
tests
=>
$test
,
todo
=> \
@todo
;
%h_todo
=
map
{
$_
=> 1}
@todo
;
# We start from test 1 (since we increment before use).
$test
= 0;
# Set up the command arguments and 'do' the satpass script. All
# further work is done by tester() when the script calls it.
local
@ARGV
= (
'-filter'
,
-initialization_file
=> File::Spec->devnull ());
$skip
=
''
;
do
$script
;
$@
if
$@;
return
;
}
# not_available(module ...) is a utility to determine whether the
# given modules are available. If so, it loads them. If not, it
# returns a message for the first module that can not be loaded.
script/satpass view on Meta::CPAN
470471472473474475476477478479480481482483484485486487488489490eod
next
;
};
# Parse any command options present. Note that GetOptions is
# configured to pass any unrecognized options because otherwise
# our relative time format would confuse it.
%cmdopt
= ();
{
# Begin local symbol block.
local
@ARGV
=
@args
;
Getopt::Long::Configure (@{
$cmdconfig
{
$verb
} ||= [
'permute'
]});
GetOptions (\
%cmdopt
,
qw{clipboard debug time}
, @{
$cmdlgl
{
$verb
} ||= []});
@args
=
@ARGV
;
}
$cmdopt
{_redirection} =
$cmdopt
{clipboard} ?
'-clipboard'
:
$redout
;
# Preserve our current output, and redirect as and if specified.
if
(
$cmdopt
{clipboard}) {
$redout
=
''
;
( run in 1.031 second using v1.01-cache-2.11-cpan-49f99fa48dc )