Hiya Frog,

A Related Module For Ya

This does not answer your question, but I have a module that works like a 'generic argument grabber' using Tk for exactly the kind of scenario you mentioned. Read further if you (or anyone else) are interested.

The Scenario

You already have a working perl script and you simply want a fast, easy, and flexible way to supply arguments to that script in a 'novice-user-friendly' 'point-and-click' kinda way.

The Background

If you are familiar with VBScript or JavaScript, you probably have heard of the *input box* function, which simply pops up a quick-and-dirty text box for user input. This is useful, but it suffers many limitations:

My Module: Synopsis

Suppose you have a script 'CreateNewEmployee.pl' that requires some input arguments, and you want an input dialog to let the novice user supply the arguments. Here is some sample code ...

### Example 000 my $get_args = {}; $get_args->{fname} = ''; $get_args->{lname} = ''; $get_args->{title} = ''; $get_args->{dept } = ''; my $usr_input = &TkDataDialog($get_args,'data_rec'); &DoCreateTheEmployeeFunction( $usr_input->{fname}, $usr_input->{lname}, $usr_input->{title}, $usr_input->{dept }, );

This example pops up a dialog that lets the user supply the specified values in a predictable looking input form. You can also use compact syntax to accomplish the same thing.

### Example 001 (compact syntax) my $usr_input = &TkDataDialog( 'fname lname title dept', 'fld_list',); &DoCreateTheEmployeeFunction( $usr_input->{fname}, $usr_input->{lname}, $usr_input->{title}, $usr_input->{dept }, );

My Module: Motivation

I wrote this to solve exactly the kind of problem you are talking about, and because I couldn't find anything on CPAN that matched my requirements closely enough.

Feature Highlights

Feature Lowlights

This code is just for those cases where you want a quick and dirty way to get input of a simple data record (aka name value pairs) and you dont really care about the exact appearance of the Tk window.

My Module: Dependencies

use Tk; use Tk::BrowseEntry; use Tk::DialogBox; use XML::Twig; ## to support xml-dialog syntax format use CSS::Tiny; ## to support css-like dialog syntax use Data::Dumper; ## only used for debugging and tests

In reply to Re: Iterating over objects by dimar
in thread Iterating over objects by Anonymous Monk

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.