Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I'm not really sure what to look for in this output...

I think the main thing is that we can now see that we're not dealing with an old perl, that PERL5OPT (and/or other perl-specific environment variables) have not been set, and that everything looks sane.
The main thing is that you look for a "standout" difference between that output and the output that you get.
If there's nothing to be seen there, as is apparently the case, then at least we know to look elsewhere.

AFAICS, the issue should be reproducible on the problem machine by running this script:
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";
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.

It's an interesting one ... even if that simplified test script successfully demonstrates the bug, then there's still the question of "why and how ??".
But let's not get too far ahead of ourselves ;-)

UPDATE: If the script I provided did not tickle the bug, then how about this one that fully reinstates the Tk stuff:
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"; }

Cheers,
Rob

In reply to Re^6: weird problem with macports perl on apple m1/m2 based system by syphilis
in thread weird problem with macports perl on apple m1/m2 based system by perltux

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-24 02:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found