Why not provide a Tk (or other) GUI instead? It needen't be all that hard. Consider:

use strict; use warnings; use Tk; use Tk::DialogBox; use Tk::Listbox; my $mw = MainWindow->new (); my %starData; my @params = ($mw, \%starData, ); $mw->Button (-text => 'Known star', -command => [\&knownStar, @params] +)->pack (); $mw->Button (-text => 'New star', -command => [\&newStar, @params])->p +ack (); $mw->Button (-text => 'List stars', -command => [\&listStars, @params] +)->pack (); $mw->Button (-text => 'Quit', -command => [\&quit, @params])->pack (); MainLoop (); sub knownStar { my ($mw, $starData) = @_; my @stars = map {[split ',']} split "\n", <<STARS; Sol, G2,1.0 Alpha Centuri A, G4,1.08 Alpha Centuri B, K1,.88 Epsilon Eridani, K2,.30 Tau Ceti, G8, .82 70 Ophiuchi A, K1,.9 70 Ophiuchi B, K5,.65 Eta Cassiopeiae A,f9,.94 Eta Cassiopeiae B,k6,.58 Sigma Draconis, G9,.82 36 Ophiuchi A, K2, .77 36 Ophiuchi B, K1,.76 Hr 7703, K2, .76 Delta Pavonis, G7,.98 82 Eridani, G5,.91 Beta Hydri, G1,1.23 Hr 8832, K3, .74 STARS my @names = map {$_->[0]} @stars; my $dlg = $mw->DialogBox ( -title => 'Select known star', -default_button => 'OK', -buttons => ['OK', 'Cancel'], ); my $listbox = $dlg->add ('Listbox', -listvariable => \@names, -selectmode => 'single' )->pack (); return if $dlg->Show () eq 'Cancel'; my @sel = $listbox->curselection (); return unless @sel; print "@{$stars[$sel[0]]}\n"; $starData->{$sel[0]} = $stars[$sel[0]]; } sub newStar { my ($mw, $starData) = @_; # Generate new star data here } sub listStars { my ($mw, $starData) = @_; } sub quit { my ($mw, $starData) = @_; # Save handling here if required exit; }

Perl reduces RSI - it saves typing

In reply to Re: World Builder: the recovery and archeology of old programs. by GrandFather
in thread World Builder: the recovery and archeology of old programs. by dwm042

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.