in reply to Perl Script on Windows Vista

And now I'm thinking its the very first line.

The shebang line is not used by Windows (although Perl itself will look for flag like "-w" in it). It is not the problem.

I suspect it's not "hanging" so much as not seeing any packets for some reason.

Replies are listed 'Best First'.
Re^2: Perl Script on Windows Vista
by burningredmoon (Novice) on Mar 28, 2011 at 21:11 UTC
    Thank you for the reply! Well that's good to know that its not that but I'm not sure why it doesn't see any packets either though.

    I'm working at home on a desktop with an Ethernet cable. Is there a way I can get the computer to receive packets? While it's running (looks like hanging) I try visting google and yahoo, just trying to get a packet. Am I going about that part the wrong way you think?

      You need to tell Net::Pcap (respectively Net::PcapUtils) about what device you want to capture packets on. For Windows, that is the (long and hard to type) full name of the device. Look at the output of

      use strict; use Data::Dumper; use Net::Pcap; Net::Pcap::findalldevs(\my %devinfo,\my $err); warn Dumper \%devinfo;

      or install Net::Pcap::FindDevice to conveniently get at devices by assigned IP address or network card name.

        I ran the code you gave me and got this
        C:\Users\Moon\Desktop>perl dumper.pl $VAR1 = { '\\Device\\NPF_{FC37432F-B79C-4FAF-9CAD-3DBF13091840}' => 'M +S Tunnel I nterface Driver', '\\Device\\NPF_{44FE3F07-BFEB-4F18-9BD8-75D2EF4D1506}' => 'N +VIDIA nFor ce MCP Networking Adapter Driver' };

        Being a software major and not a networking one, I have no clue what that means.

        I have the Net::Pcap and Net::PcapUtils packages installed, Net::Pcap::FindDevice should be included, correct?