in reply to Passing arguments for GUI development in Tk

Hello archana12, and welcome to the Monastery!

I don’t understand why you would want to pass the name of the Perl script to the GUI module? The other three options can just be handled in the normal way. For example, the following script combines example code from the synopses for Getopt::Long and Tk:

#! perl use strict; use warnings; use Getopt::Long; use Tk; my ($i, $d, $o); GetOptions ("i=s" => \$i, "d=s" => \$d, "o=i" => \$o) or die "Error in command line arguments: $!"; my $mw = MainWindow->new; $mw->Label(-text => "$i #$o")->pack; $mw->Button ( -text => $d, -command => sub { exit }, )->pack; MainLoop;

You could then call it like this (using wperl in place of perl to by-pass the console):

>wperl 1374_SoPW.pl -o 42 -i Title -d Quit

(If that doesn’t answer your question, please explain what you’re looking for in greater detail.)

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,