I'm trying to test out the Perl module CGI::ProgressBar latest version 0.05 on CentOS 7, perl 5.26. After installing it and run the sample script from metacpan.org (ref: https://metacpan.org/pod/release/LGODDARD/CGI-ProgressBar-0.05/lib/CGI/ProgressBar.pm ), Firefox's web console debugger throws a syntax error on ProgressBar.pm, line 343: "missing } after function body". I then added the closing bracket to line 352, and re-run. Error went away , but there's no progress bar shown. So, questions:
Why this Perl module exists on metacpan even when it has syntax error and does not run?
How to get at least the sample synopsis example to run and display the progress bar properly?
If this module's no longer maintained, could Cpan admins remove or mark it as obsolete to prevent any confusion. And recommendation of any other libraries that shows progress bar for Perl's CGI script is greatly appreciated!
Sample code from metacpan:
use strict;
use warnings;
use CGI::ProgressBar qw/:standard/;
$| = 1; # Do not buffer output
print header,
start_html(
-title=>'A Simple Example',
-style=>{
-src => '', # You can override the bar style here
-code => '', # or inline, here.
}
),
h1('A Simple Example'),
p('This example will update a JS/CSS progress bar.'),
progress_bar( -from=>1, -to=>100 );
# We're set to go.
for (1..10){
print update_progress_bar;
# Simulate being busy:
sleep 1;
}
# Now we're done, get rid of the bar:
print hide_progress_bar;
print p('All done.');
print end_html;
exit;