Thank you for all your good work for Perl on CPAN! I use your Astro modules constantly to power my planetariums and clocks. I'd like to see your 30 lines. Here is one that puts SIMBAD data in a perl hash:
perl -MAstro::SIMBAD::Client -MData::Dumper -le '$s=Astro::SIMBAD::Cli +ent->new;@s=split/\n/,$s->url_query(id => Ident => "$ARGV[0]", NbIden +t => 1);splice(@s,0,7);splice(@s,20,$#s+1);%s=map{/([^:]+\S)\s?:\s+(\ +S.*)/;$1=>$2}@s;@s=grep/^Coord/,keys%s;print"$_: $s{$_}"for@s;print q +q[\n$s{"Proper motions"}\n];print Dumper\%s;' sirius
Prints coordinates and proper motions and dumps the hash:
Coordinates(Gal,ep=J2000,eq=2000): 227.23029126 -08.89028121 Coordinates(ICRS,ep=J2000,eq=2000): 06 45 08.91728 -16 42 58.0171 (Op +t ) A [11.70 10.90 90] 2007A&A...474..653V Coordinates(FK4,ep=B1950,eq=1950): 06 42 56.72452 -16 38 45.4080 -546.01 -1223.07 [1.33 1.24 0] A 2007A&A...474..653V $VAR1 = { 'Angular size' => '~ ~ ~ (~) ~ ~', 'Coordinates(Gal,ep=J2000,eq=2000)' => '227.23029126 -08.89 +028121 ', 'Spectral type' => 'A0mA1Va C 2003AJ....126.2048G', 'Parallax' => '379.21 [1.58] A 2007A&A...474..653V', 'Flux V' => '-1.46 [~] C 2002yCat.2237....0D', 'Flux I' => '-1.43 [~] C 2002yCat.2237....0D', 'Flux J' => '-1.36 [~] C 2002yCat.2237....0D', 'Flux R' => '-1.46 [~] C 2002yCat.2237....0D', 'Redshift' => '-0.000018 [0.000001] A 2006AstL...32..759G', 'Proper motions' => '-546.01 -1223.07 [1.33 1.24 0] A 2007A& +A...474..653V', 'Flux K' => '-1.35 [~] C 2002yCat.2237....0D', 'Morphological type' => '~ ~ ~', 'Flux H' => '-1.33 [~] C 2002yCat.2237....0D', 'cz' => '-5.50 [0.40] A 2006AstL...32..759G', 'Flux U' => '-1.51 [~] C 2002yCat.2237....0D', 'Radial Velocity' => '-5.50 [0.4] A 2006AstL...32..759G', 'Flux B' => '-1.46 [~] C 2002yCat.2237....0D', 'Coordinates(ICRS,ep=J2000,eq=2000)' => '06 45 08.91728 -16 + 42 58.0171 (Opt ) A [11.70 10.90 90] 2007A&A...474..653V', 'Coordinates(FK4,ep=B1950,eq=1950)' => '06 42 56.72452 -16 +38 45.4080', 'hierarchy counts' => '#parents=0, #children=0, #siblings=0' };
PS - I think the easiest way to get deg2rad (and rad2deg) is a core module:
use Math::Trig 'deg2rad';

In reply to Re^2: perl in the stars by Anonymous Monk
in thread perl in the stars by Aldebaran

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.