Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: "percent task completed progress bar" in cli interface, how?

by Booger (Pilgrim)
on Jul 21, 2006 at 00:57 UTC ( #562750=note: print w/ replies, xml ) Need Help??


in reply to Re^3: "percent task completed progress bar" in cli interface, how?
in thread "percent task completed progress bar" in cli interface, how?

If you use the warnings pragma you'll find that the original code produces the following error

Invalid conversion in sprintf: "%)" at test.pl line 16.

The sprintf function documentation specifies that a percent sign should be formatted '%%'. I'm not sure why excluding the extra '%' doesn't count as a syntax error.

From what I can tell the warning has been emitted via warnings since around 5.8.0. FYI I'm using 5.8.7 from Ubuntu 6.06 with the patch "SPRINTF0 - fixes for sprintf formatting issues - CVE-2005-3962." This patch is applied by either the Debian team or Ubuntu team (not sure which one). I think the patch originated from http://www.cpan.org/modules/by-module/Compress/NWCLARK/sprintf-5.8.7.patch.

So you might not be wrong per-se but sprintf in versions of Perl without this patch certainly don't do what the manual says it should.

Cheers,
Matt


Comment on Re^4: "percent task completed progress bar" in cli interface, how?
Re^5: "percent task completed progress bar" in cli interface, how?
by zentara (Archbishop) on Jul 21, 2006 at 12:33 UTC
    Thanks, I should have been using strict and warnings.

    I'm not really a human, but I play one on earth. Cogito ergo sum a bum

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://562750]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2014-07-12 09:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (239 votes), past polls