Show quoted text> > Attached is a patch to get it to work for Perl 5.6.1 and later;
> > ppport.h supports earlier versions, but I don't think it's worth
> > backporting to versions you don't intend testing on.
> I don't intend to actively support 5.6 either. It's too buggy to be
> useful to me under any circumstances, so it would add considerable
> maintainance burden. If you wanted to keep an eye on it, though, and
> the changes aren't too invasive, I wouldn't mind applying patches to
> the effect.
Yes, what I'll do is share my 5.6.1 compat patches while I am using it
on that Perl, which probably won't be for more than a year.
Show quoted text> Some question about the patch, though:
>
> +use warnings;
> +no warnings "uninitialized";
>
> I do not intend to enable warnings by default.
OK, this means I misread the intent of what you were doing. It was just
to avoid a "use of bareword 'warnings' may conflict with future reserved
word..." warning. Turning on "use strict" should sort that out - the
bareword will be considered illegal.
Show quoted text> +# this is slightly PL_dirty (should expose a c-level api)
> This seems to be the result of a straight search and replace on the
> code. It seesm these and similar changes are, too:
> - COP *curcop;
> + COP *PL_curcop;
> Or are they really necessary? They uglify the code quite a bit, and I
> am sure it'll break on some platforms.
I ran the ppport.h against the distribution, and applied the patch it
recommended. Perhaps some of the substitutions it suggested were based
on sloppy regexes and are not necessary.
Here are the exact steps I used to create the patch (other than manual
editing for the "use warnings" bit):
h2xs -n Foo -A -b5.6.1
cp Foo/ppport.h Coro-1.5/
cd Coro-1.5
perl ppport.h --patch=backport --compat-version=5.6.1
patch -p0 < backport
find Coro Event -type f | xargs grep -l ppport \
| perl -npi~ -e 's{ppport.h}{../ppport.h}'
I guess I could go through the patch and find the minimal set of changes
that are actually required for it to compile on 5.6. Do you want me to
do this?
As far as portability goes, AIUI the ppport.h script suggests code
changes that makes the module use functions that are considered "best
practice", then uses macros to make the older perls support this newer
best practice. So, they should enhance portability between platforms,
not reduce it.
Just one more piece I missed before; for some reason the test suite
spits out an error during global destruction in t/09_timer.t:
(in cleanup) Can't call method "cancel" on an undefined value at
blib/lib/Coro/Timer.pm line 79.
Without digging into the possible causes of this, given all that method
is doing is breaking circular refs, it's probably worth just adding a
guard to it:
--- Coro-1.5.orig/Coro/Timer.pm Tue Nov 29 12:35:50 2005
+++ Coro-1.5.backport/Coro/Timer.pm Tue Dec 6 00:08:50 2005
@@ -75,7 +76,7 @@
}
sub DESTROY {
- ${${$_[0]}}->cancel;
+ ${${$_[0]}}->cancel if ${${$_[0]}};
undef ${${$_[0]}}; # without this it leaks like hell. breaks the
circular reference inside the closure
}
ps. you can log into rt.cpan.org with your PAUSE ID and password rather
than use guest.