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', );

In reply to Opening another Perl script in Current Window using the perl Tk module by TheNewGuyShubh

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.