Skip Menu |

This queue is for tickets about the File-PCAP CPAN distribution.

Report information
The Basics
Id: 123020
Status: resolved
Worked: 15 min
Priority: 0/
Queue: File-PCAP

People
Owner: mamawe [...] cpan.org
Requestors: jeremy.mates [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: v0.0.5



Subject: documented File::PCAP::Writer->new( $fname ) fails
$ perl -MFile::PCAP::Writer -e 'File::PCAP::Writer->new( "blah" )' Can't use string ("blah") as a HASH ref while "strict refs" in use at .../File/PCAP/Writer.pm line 72. $ The code appears to instead accept a hash reference. Either the code needs to be changed to accept a single filename, or the documentation updated to show the correct usage: --- Writer.pm.orig 2017-09-12 06:59:24.000000000 -0700 +++ Writer.pm 2017-09-12 07:48:30.000000000 -0700 @@ -25,7 +25,7 @@ use File::PCAP::Writer; - my $fpw = File::PCAP::Writer->new( $fname ); + my $fpw = File::PCAP::Writer->new({ fname => $fname }); $fpw->packet( $tsec, $usec, $blen, $plen, $buf );
On Tue Sep 12 10:49:13 2017, JMATES wrote: Show quoted text
> $ perl -MFile::PCAP::Writer -e 'File::PCAP::Writer->new( "blah" )' > Can't use string ("blah") as a HASH ref while "strict refs" in use at > .../File/PCAP/Writer.pm line 72. > $ > > The code appears to instead accept a hash reference. Either the code > needs to be changed to accept a single filename, or the documentation > updated to show the correct usage:
Thanks for reporting this. I changed the documentation in v0.0.5. It should be available on CPAN soon. Kind regards, Mathias
Documentation is changed.