Skip Menu |

This queue is for tickets about the IO-Handle-Packable CPAN distribution.

Report information
The Basics
Id: 131289
Status: patched
Priority: 0/
Queue: IO-Handle-Packable

People
Owner: Nobody in particular
Requestors: nomad [...] null.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Documentation bug
Date: Sun, 29 Dec 2019 14:43:32 +0100
To: bug-IO-Handle-Packable [...] rt.cpan.org
From: Mark Lawrence <nomad [...] null.net>
Hi Paul, I think you meant to open a "read" (<) handle instead of a "write" (>) one: use IO::Handle::Packable; my $fh = IO::Handle::Packable->new; $fh->open( "my-data.dat", ">" ); ##### HERE ##### while( my ( $x, $y, $value ) = $fh->unpack( "S S i" ) ) { print "Value at ($x,$y) is $value\n"; } The above code loops forever when the file is empty... Cheers, Mark -- Mark Lawrence
Ahyes, noted. -- Paul Evans
Subject: rt131289.patch
=== modified file 'lib/IO/Handle/Packable.pm' --- old/lib/IO/Handle/Packable.pm 2018-08-06 13:52:17 +0000 +++ new/lib/IO/Handle/Packable.pm 2020-01-28 02:27:37 +0000 @@ -26,7 +26,7 @@ use IO::Handle::Packable; my $fh = IO::Handle::Packable->new; - $fh->open( "my-data.dat", ">" ); + $fh->open( "my-data.dat", "<" ); while( my ( $x, $y, $value ) = $fh->unpack( "S S i" ) ) { print "Value at ($x,$y) is $value\n";