in reply to Iterating over objects

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