Skip Menu |

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

Report information
The Basics
Id: 122884
Status: new
Priority: 0/
Queue: Term-ProgressBar

People
Owner: Nobody in particular
Requestors: MOB [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 2.15
  • 2.16
  • 2.17
  • 2.18
  • 2.19
  • 2.20
  • 2.21
Fixed in: (no value)



Subject: Regular filehandle not recognized as a "seekable" filehandle
Background at https://stackoverflow.com/questions/45827030 Term::ProgressBar::IO does not recognize a regular filehandle. In the `Term::ProgressBar::IO::init` function, a regular filehandle will often not pass the test ref($count) && $count->can('seek') Success can depend on the version of perl, whether the `IO::File` module has been loaded, and whether the filehandle has previously made a method call. The fix suggested on the stackoverflow question will only work for recent perls (5.24 or better, maybe 5.22). A more robust check that will work for perl >=5.12 is something like ref($count) && eval { $count->seek(0,SEEK_CUR);1 } For perl 5.10 or older, the object oriented calls don't seem to work at all and you may want to resort to a different implementation of the `init`, `__determine_max`, and `__determine_count` methods to handle that case.