in reply to Re^5: weird problem with macports perl on apple m1/m2 based system
in thread weird problem with macports perl on apple m1/m2 based system
If that doesn't reproduce the problem, then I would begin reinstating bits of the original script to it (starting by commenting in the "use Tk;" line) until you hit the point where the problem does kick in.use warnings; #use Tk; print "result:\n"; $_A = '16.25'; # string, not number $_V = '12.99'; # string, not number $formula = 'sprintf("%.0f", ($_V * $_A))'; $_W = eval($formula); print "$_V\n"; print "$_A\n"; print "$_W\n";
use warnings; use Tk; my $mw=MainWindow->new(); $mw->Button(-text=>" Test ", -command=>sub{test()}, -font=>'Helvet +ica 18 bold', -pady=>20)->pack(); MainLoop; sub test { print "result:\n"; $_A = '16.25'; # string, not number $_V = '12.99'; # string, not number $formula = 'sprintf("%.0f", ($_V * $_A))'; $_W = eval($formula); print "$_V\n"; print "$_A\n"; print "$_W\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: weird problem with macports perl on apple m1/m2 based system
by perltux (Monk) on Jun 17, 2023 at 05:21 UTC | |
by syphilis (Archbishop) on Jun 17, 2023 at 05:52 UTC | |
by hippo (Archbishop) on Jun 17, 2023 at 10:27 UTC |