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 );