Astro-SIMBAD-Client
view release on metacpan or search on metacpan
0.018 2009-04-09 T. R. Wyant
Distribute developer tests, but only run if DEVELOPER_TEST is set.
Comply with Perl::Critic using profile t/perlcriticrc.
Criticize code as part of developer testing.
Drop unneeded 'use FileHandle' from Build.PL.
Have Build.PL and Makefile.PL handle -y and -n to supress prompt and
install or not install simbadc respectively.
Correct 'help client' in bin/simbadc
Update t/vo.t to track the fact that the SIMBAD4 URL query has gone
back to decimal degrees for position.
0.017 2008-11-29 T. R. Wyant
Fix test failure when YAML::Syck installed but YAML not.
Makefile.PL view on Meta::CPAN
use 5.008;
use strict;
use warnings;
use lib qw{ inc };
use My::Module::Meta;
use My::Module::Recommend;
use Config;
use ExtUtils::MakeMaker qw{WriteMakefile prompt};
use Getopt::Std;
my %opt;
getopts('ny', \%opt) or die <<eod;
The only legal options are
-n = answer all questions 'no'.
-y = answer all questions 'yes'.
You may not assert both of these at once - it's too confusing.
eod
script/simbadc view on Meta::CPAN
the first token being the command/method name.
If a token begins with '>' or '>>', the rest of the token represents
the name of a file to which the output of that command is redirected.
The '>' overwrites an existing file, while '>>' appends to it. There
can be no space between the '>' or '>>' and the file name.
A token beginning with '<<' introduces a 'here document', which appears
on subsequent lines of input. The rest of the token represents the text
which marks the end of the 'here document'. If the script is being run
interactively, the end text will also be used as the prompt. For
example:
simbadc> set format <<eod
eod>txt=---\n
eod>name: %idlist(NAME|1)\n
eod>ra: %coord(d;A)\n
eod>dec: %coord(d;D)\n
eod>eod
simbadc>
script/simbadc view on Meta::CPAN
########################################################################
#
# Utility subroutines
#
# $doc = _heredoc ($label)
#
# This subroutine reads input until it hits the given label, and
# returns the input. If input is interactive, the $label is also
# used as the prompt.
sub _heredoc {
my $lbl = shift;
$lbl =~ s/^<+//;
my @inf;
while (defined (my $buffer = _readline ($lbl))) {
chomp $buffer;
last if $buffer eq $lbl;
push @inf, $buffer . "\n";
}
script/simbadc view on Meta::CPAN
$_ = '<<eod';
} elsif (m/['\s]/m) {
s/'/\\'/g;
$_ = "'" . $_ . "'";
}
push @rslt, $_;
}
return "@rslt\n@append";
}
# $input = _readline ($prompt)
# This subroutine Does the Right Thing depending on whether input
# is from the keyboard. The $prompt defaults to 'Simbadc', and
# '> ' is appended to the prompt before use.
sub _readline {
my $prompt = (shift || 'Simbadc') . '> ';
return $rl ? $rl->readline ($prompt) : <$fh>
}
__END__
=back
Any command not named above is assumed to be an Astro::SIMBAD::Client
method, and called. Whatever the method returns is displayed,
unless the return is an Astro::SIMBAD::Client object.
( run in 0.720 second using v1.01-cache-2.11-cpan-0b5f733616e )