Comments on: Bad AnyEvent Installhttps://curiousprogrammer.wordpress.com/2010/04/27/bad-anyevent-install/
Thoughts on Perl and Emacs, technology and writingSun, 05 Apr 2015 05:50:01 +0000hourly1http://wordpress.com/By: schmorphttps://curiousprogrammer.wordpress.com/2010/04/27/bad-anyevent-install/#comment-8688
Tue, 14 Dec 2010 15:47:59 +0000http://curiousprogrammer.wordpress.com/?p=836#comment-8688Indeed, this is not a bug in AnyEvent – compiling a module on a different operating only works by pure chance. A module doesn’t need to contain any C code to be architecture-dependent.

While there are ways to redefine WIN32 so that AnyEvent sees it, this does nothing to the other constants, which are likely to be very different.

The only correct method is to not share arch-dependent modules between operating systems (you wouldn’t expect the perl binary from unix to run under windows, either…)

]]>By: Jaredhttps://curiousprogrammer.wordpress.com/2010/04/27/bad-anyevent-install/#comment-7896
Wed, 28 Apr 2010 21:47:08 +0000http://curiousprogrammer.wordpress.com/?p=836#comment-7896@zloyrusskiy – thanks for the solution it looks good. I still don’t think I would say there is a bug in AnyEvent despite the fact it is solvable. Installing on one Perl on Unix and expecting it to work on a Windows Perl is a little unreasonable. What do you think?

Anyway, I’ll get your solution off to Marc and see if he wants to incorporate it into a later version.

@juster – gosh, that solution looks complicated. First good chance to use require hooks eh? :) I’ll have to look at it in detail to understand it.

I’m guessing this is why the constant.pl is generated in the first place. If there is an if statement inside sub WIN32 () {} it will not be inlined. Hence the if statement is converted to its result when creating the constant function.

I don’t think this is a bug, at least not in AnyEvent. It is an artefact that results from the slightly whacky way my firm installs perl modules.

And I don’t have write access to the constants.pl file unfortunately.

Hi juster,

That is a cool solution. My thought was the slightly more boring generate my own constants.pl file and make sure it was ahead of the real constant.pl in @INC (although I haven’t tried that yet).

]]>By: justerhttps://curiousprogrammer.wordpress.com/2010/04/27/bad-anyevent-install/#comment-7891
Wed, 28 Apr 2010 06:19:51 +0000http://curiousprogrammer.wordpress.com/?p=836#comment-7891This problem intrigued me. I always found it magical how you can override another module’s symbol table entry, but the only module it will affect is your own! I mean you only notice a difference if you call that changed symbol table entry (subroutine) from your module.

Anyways, the only way I could think of to bypass constants was for you to make a YOUR OWN constant.pm file and have it act as a proxy between the real constant.pm and everyone else.