perl.j has asked for the wisdom of the Perl Monks concerning the following question:
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Perl/Tk System Function Error
by keszler (Priest) on Nov 18, 2011 at 01:07 UTC | |
by afoken (Chancellor) on Nov 18, 2011 at 10:20 UTC | |
by Anonymous Monk on Nov 18, 2011 at 09:07 UTC | |
by perl.j (Pilgrim) on Nov 18, 2011 at 01:10 UTC | |
Re: Perl/Tk System Function Error
by zentara (Archbishop) on Nov 18, 2011 at 12:32 UTC |
Back to
Seekers of Perl Wisdom