#!/usr/local/bin/perl
our
$VERSION
=
'0.001'
;
my
%opt
;
my
$usage
=
<<eod;
Get manned spaceflight data. An internet connection is needed.
Output goes to standard out.
usage: spaceflight [options]
where the legal options are:
-all
gets all data, rather than just the current data;
-help
displays this message;
-name
retrieves the data as so-called 'NASA 2-line elements', with the
name of the satellite before each element set.
eod
GetOptions (\
%opt
,
qw{all help name}
) or
die
$usage
;
$opt
{help} and
do
{
print
$usage
;
exit
};
my
$st
= Astro::SpaceTrack->new (
with_name
=>
$opt
{name});
my
$rslt
=
$st
->spaceflight (
$opt
{all} ?
'-all'
: ());
$rslt
->is_success or
die
$rslt
->status_line;
print
$rslt
->content;