Skip Menu |

This queue is for tickets about the Term-ProgressBar CPAN distribution.

Report information
The Basics
Id: 123466
Status: resolved
Priority: 0/
Queue: Term-ProgressBar

People
Owner: MANWAR [...] cpan.org
Requestors: djerius [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.21
Fixed in: 2.22



Subject: Use of uninitialized value $name in printf if not output to a terminal
Howdy. Attached is a slightly modified version of example/simple_use.pl with term => 0 which illustrates the bug. Upon running it, I get the folowing output: se of uninitialized value $name in printf at [...]/lib/site_perl/5.22.1/Term/ProgressBar.pm line 937. [Tue Oct 31 14:34:42 2017] : 0% Use of uninitialized value $name in printf at [...]/lib/site_perl/5.22.1/Term/ProgressBar.pm line 937. [Tue Oct 31 14:34:42 2017] : 0% Use of uninitialized value $name in printf at [...]/lib/site_perl/5.22.1/Term/ProgressBar.pm line 937. [Tue Oct 31 14:34:42 2017] : 0% Use of uninitialized value $name in printf at [...]/lib/site_perl/5.22.1/Term/ProgressBar.pm line 937. [Tue Oct 31 14:34:42 2017] : 0% Use of uninitialized value $name in printf at [...]/lib/site_perl/5.22.1/Term/ProgressBar.pm line 937. [Tue Oct 31 14:34:42 2017] : 0% Use of uninitialized value $name in printf at [...]/lib/site_perl/5.22.1/Term/ProgressBar.pm line 937. [Tue Oct 31 14:34:42 2017] : 0% Use of uninitialized value $name in printf at [...]/lib/site_perl/5.22.1/Term/ProgressBar.pm line 937. [Tue Oct 31 14:34:42 2017] : 0% Use of uninitialized value $name in printf at [...]/lib/site_perl/5.22.1/Term/ProgressBar.pm line 937. [Tue Oct 31 14:34:42 2017] : 0% Use of uninitialized value $name in printf at [...]/lib/site_perl/5.22.1/Term/ProgressBar.pm line 937. [Tue Oct 31 14:34:42 2017] : 0% Use of uninitialized value $name in printf at [...]/lib/site_perl/5.22.1/Term/ProgressBar.pm line 937. [Tue Oct 31 14:34:42 2017] : 0% Use of uninitialized value $name in printf at [...]/lib/site_perl/5.22.1/Term/ProgressBar.pm line 937. [Tue Oct 31 14:34:42 2017] : 0% Use of uninitialized value $name in printf at [...]/lib/site_perl/5.22.1/Term/ProgressBar.pm line 937. [Tue Oct 31 14:34:42 2017] : 1% Use of uninitialized value $name in printf at [...]/lib/site_perl/5.22.1/Term/ProgressBar.pm line 937. [Tue Oct 31 14:34:42 2017] : 2% Use of uninitialized value $name in printf at [...]/lib/site_perl/5.22.1/Term/ProgressBar.pm line 937. [Tue Oct 31 14:34:42 2017] : 4% Use of uninitialized value $name in printf at [...]/lib/site_perl/5.22.1/Term/ProgressBar.pm line 937. [Tue Oct 31 14:34:42 2017] : 8% Use of uninitialized value $name in printf at [...]/lib/site_perl/5.22.1/Term/ProgressBar.pm line 937. [Tue Oct 31 14:34:42 2017] : 16% Use of uninitialized value $name in printf at [...]/lib/site_perl/5.22.1/Term/ProgressBar.pm line 937. [Tue Oct 31 14:34:42 2017] : 32% Use of uninitialized value $name in printf at [...]/lib/site_perl/5.22.1/Term/ProgressBar.pm line 937. [Tue Oct 31 14:34:43 2017] : 65%
Subject: simple_use.pl
#!/usr/bin/perl use strict; use warnings; use Term::ProgressBar 2.00; use constant MAX => 100_000; my $progress = Term::ProgressBar->new({ term => 0, count => MAX }); for (0..MAX) { my $is_power = 0; for(my $i = 0; 2**$i <= $_; $i++) { $is_power = 1 if 2**$i == $_; } if ( $is_power ) { $progress->update($_); } }
This is now patched, thanks to @lharey for the PR. https://github.com/manwar/Term-ProgressBar/pull/10
On Sat May 12 20:59:18 2018, MANWAR wrote: Show quoted text
> This is now patched, thanks to @lharey for the PR. > > https://github.com/manwar/Term-ProgressBar/pull/10
Thanks!