in reply to Re^5: "Undefined subroutine &main::pcap_lookupdev called" yet module installed and PERL5LIB is set correctly : *(
in thread "Undefined subroutine &main::pcap_lookupdev called" yet module installed and PERL5LIB is set correctly : *(

I defer to your clearly far greater understanding of perl : ) I'm running out of ideas fast other than trying a different version of the Net::Pcap module. I mean, I don;t know how to fix this and I have to be be able to use the module directly. I'll also try it on a linux host but i get the feeling it'll work and give me no further clues even with the same directory paths and PERL5LIB and same code : * {
  • Comment on Re^6: "Undefined subroutine &main::pcap_lookupdev called" yet module installed and PERL5LIB is set correctly : *(

Replies are listed 'Best First'.
Re^7: "Undefined subroutine &main::pcap_lookupdev called" yet module installed and PERL5LIB is set correctly : *(
by Khen1950fx (Canon) on Jun 10, 2009 at 19:40 UTC
    try this:

    #!/usr/bin/perl use Net::Pcap qw( :functions ); $|=1; my $err = ''; my $dev = lookupdev(\$err); my $pcap = open_live( $dev, 1024, 1, 0, \$err ); loop( $pcap, 10, \&process_packet, "just for the demo" ); pcap_close( $pcap ); sub process_packet { my($user_data, $header, $packet ) = @_; }
      Wow. That worked !! looking at the actual module itself I can see now that the sub names are not prefixed with "pcap_" as the documentation suggests. Thanks guys so very much for all your help. I really appreciate it. If you have any way I can donate a beer then just say the word : )))