I am making an "all-in-one calculator" (I guess). Here is my code (I know I do not have all subroutines defined, I'm still working on this as you can see):

use 5.12.4; use warnings; use Tk; ##### Create MainWindow ##### my $button_menu = new MainWindow; ############################# ##### MainWindow Buttons##### my $calculator_button = $button_menu->Button(-text=>"Calculator", -width=>10, -relief=> 'raised', -command=>\&open_calculator)->pack(); my $formulas_button = $button_menu->Button(-text=>"Formulas", -width=>10, -relief=> 'raised', -command=>\&open_formulas)->pack(); my $lcf_button = $button_menu->Button(-text=>"Find LCF", -width=>10, -relief=> 'raised', -command=>\&open_lcf)->pack(); my $gcf_button = $button_menu->Button(-text=>"Find GCF", -width=>10, -relief=> 'raised', -command=>\&open_gcf)->pack(); ############################# sub open_calculator{ system(qq{start "C:\\Windows\\system32\\calc.exe"}); } MainLoop;

Why does the system function not open the Windows calculator? Also, is there any source code I could use to make a basic calculator in Tk?

Thanks!

--perl.j

In reply to Perl/Tk System Function Error by perl.j

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.