TheNewGuyShubh has asked for the wisdom of the Perl Monks concerning the following question:
Hello Perl Experts
I am trying to opening another perl file(I mean run the perl script file which is another Tk perl Gui window) in my current perl tk Window. I have created a menu and and trying to access the file using open but this only reads the files and I cannot run the perl code in the file. I am new to Perl so your help is really appreciated! TIA! TheNewGuyShubh
my $mw = MainWindow->new(); $mw->title("Test"); $mw->geometry('300x300'); my $menubar1 = $mw->Frame(qw/-relief raised -borderwidth 2/); $menubar1->pack(qw/-fill x/); my $file1 = $menubar1->Menubutton(qw/-text File -underline 0/,); # -menuitems => file_menuitems); my $edit1 = $menubar1->Menubutton(qw/-text Edit -underline 0/,); #-menuitems => edit_menuitems); my $help1 = $menubar1->Menubutton(qw/-text Help -underline 0/, ); #-menuitems => help_menuitems); $file1->pack(qw/-side left/); $edit1->pack(qw/-side left/); $help1->pack(qw/-side right/); my $new = $file1->cascade( -label => 'Open', -accelerator => 'Ctrl-n', -underline => 0, ); $new->command( -label => 'CRA', -accelerator => 'Ctrl-o', -underline => 1, -command => open my $fh,'<','C:/User/MyUser/Desktop/CRA.pl', );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Opening another Perl script in Current Window using the perl Tk module
by ExReg (Priest) on Sep 12, 2016 at 16:46 UTC | |
|
Re: Opening another Perl script in Current Window using the perl Tk module
by kcott (Archbishop) on Sep 14, 2016 at 12:31 UTC | |
|
Re: Opening another Perl script in Current Window using the perl Tk module
by Anonymous Monk on Sep 14, 2016 at 19:46 UTC |