dilipmanu has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I am using a perl script to parse pcap file to extract some data from the packets and the first few lines in the script are as given below.

use Net::Pcap; use NetPacket::Ethernet; use NetPacket::IP; use NetPacket::TCP; use strict; use warnings;

When i ran the program, i got an error of Net/Pcap.pm not found. so i installed, libpcap and NetPcap. Then i got an error for the second line "Can't locate NetPacket/Ethernet.pm".

I read in other forums that installing CPAN will work. I wanted to know whether installing CPAN is a good option or do we get NetPacket module to install? Please help.

Replies are listed 'Best First'.
Re: Can't locate NetPacket/Ethernet.pm
by desemondo (Hermit) on Jul 08, 2010 at 03:20 UTC
    Welcome to the monastery,

    CPAN is a great module that makes installing other modules much easier.
    CPAN doesn't provide the NetPacket/Ethernet.pm module. You need to either install that module manually, or use the CPAN module to install it.

    Since CPAN is a core module, it should already be installed where you're using Perl. To use it to install the NetPacket/Ethernet.pm module it should simply be the following:

    os prompt>cpan cpan> install NetPacket::Ethernet

    Update:
    CPANPLUS appears to be a successor of CPAN, though I don't have any experience with it yet.