Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Oh, just for the records, the version 0.09 should work on ActivePerl, and you can install the PPM from Randy Kobes' repositories. See []

    (I know, it's ActivePerl, not Cygwin; but Cygwin is a little tough to get right, as it partially relies on Win32 to use WinPcap.)

    Close the world. txEn eht nepO
    • Hi, thanks for commenting, Sébastien. No, I am afraid there is nothing sufficiently different in v0.09 that it can work under Cygwin. It doesn't. Two things stand out in the overview of WinPcap and Net::Pcap that I've gotten over the last couple of days. One is that nowhere that I have seen is anyone claiming that WinPcap is software that has been ported to Cygwin. The clear claim is that WinPcap "can be built using cygwin", and I've established, by looking hard at the build infrastructure (Makefiles) and readme-s for WinPcap, that this claim is a case of inaccurate terminology. The second standout is that Jean-Louis Morel does not seem to document a case of getting Net::Pcap to work under Cygwin's Perl, nor is there any instance available under extensive Google-ing, of anyone else ever showing or claiming that this has happened.

      WinPcap has Makefiles (named GNUmakefile) that use the -mno-cygwin switch to gcc. Even if you are not a Win32 or a Cygwin programmer, I am afraid you need to know about this switch, yes! -- in order to avoid being misled (deliberately or not) by people claiming things that aren't true. This switch causes the cygwin/mingw GCC compiler system to assume the other half of its dual nature: that of a compiler / preprocessor / assembler /linker etc. that only knows about the Microsoft C runtime library and nothing whatsoever about the Cygwin1.dll POSIX emulation C runtime. Specifically when run this way: the headers in /usr/include (the location of a standard system library, same with Cygwin as with any *NIX -- which is part of point of Cygwin, in case you didn't realize that) are not part of the preprocessor search path.

      Since the Politecnico di Torino folk are kind of claiming (misleadingly) to have software that "compiles under Cygwin" but does not (it is 100% Win32 software, no Cygwin), someone might have claimed to you that Net::Pcap can run under cygwinperl. It rather looks from the existing RT entries, the files in your module's tree, etc, as well as you own comment above, that the main person who might have been claiming this to you is Jean-Louis Morel. However, even at [] Jean-Louis does not appear to be claiming that he got Net::Pcap to work under Cygwin. He claims to have gotten it to work with Win32, and these two things are not the same. Cygwin Perl is internally much more like a GNU/Linux or BSD Perl* than it is like Perl for Win32 (by ActiveState or anywhere else).

      If my analysis turns out to be correct, I humbly suggest that a fairly important update to Net::Pcap is due, and that update be to make the first documentation that the user sees be a notice that the module will not work with Cygwin's native Perl software, period. The Makefile.PL needs to be changed to not fool around: $^O =~ /cygwin/ and die "Cannot use with Cygwin".

      *Cygwin Perl is compiled using the Cygwin/MinGW GCC compiler system in cygwin mode. The definitions of socket, networking symbols in the cygwin headers clash with the winsock or winsock2 definitions. If Jean-Louis Morel is actually claiming (privately to you) to have worked around this fundamental problem, I would be very excited to see him document his procedure publicly so that we can reproduce it.

      Finally, I hope that you won't take this recitation of hard, factual information as some sort of attack on yourself, Jean-Louis, or anyone else. I am a volunteer too. This reply is part of an attempt to (perhaps a bit forcefully) impose some clarity and reality on a set of independent, unrelated software projects and the available public documentation of those projects, that seems to be somewhat lacking. That's to benefit users, not to "prove anyone wrong."

      Best Regards.

      • Ok, I took some time and used a Windows system with a Cygwin to test Net::Pcap myself. I have to admit that it's far from being obvious, but all this comes from the fact that Cygwin pretends to be a Unix system (it internally defines itself as a Unix, offers the Unix API, and defines the preprocessor macro _unix). But in fact, it is really bound by the limitations of the Win32 system on which it runs. It usually works in an quite acceptable manner, but in some corner cases can lead to strange behaviour beca

        Close the world. txEn eht nepO
        • Hello again, Sébastien. No good news, and no bar of chocolate, I'm afraid.

          The technique you cited above is unacceptable to me exactly as given, because the contents of /usr/include are managed by the Cygwin package management system. I under no circumstances will manually copy files into that directory as a matter of programmer / sysadmin discipline. The evils that can stem from that act are manifold, and include being unable to reproduce user errors reported by anyone who trie