Skip Menu |

This queue is for tickets about the warnings-compat CPAN distribution.

Report information
The Basics
Id: 27908
Status: resolved
Priority: 0/
Queue: warnings-compat

People
Owner: Nobody in particular
Requestors: mschwern [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.03
Fixed in: 0.04



Subject: Install at least warnings::compat so the CPAN shell knows its installed
On modern perls, warnings::compat will not install itself to avoid blowing over the real warnings.pm. This is good but I realize there's a problem. Since nothing is installed things like the CPAN shell don't realize that the dependency has been resolved. For each module which declares a dependency on warnings::compat the CPAN shell will download and install warnings::compat. It should install warnings::compat to indicate its already there and stop the continual reinstallation. Simply replace the PM line in Makefile.PL with the following. ( $] >= 5.006 ? (PM => { "lib/warnings/compat.pm" => '$(INST_LIBDIR)/warnings/compat.pm' }) : () ),
Subject: Re: [rt.cpan.org #27908] Install at least warnings::compat so the CPAN shell knows its installed
Date: Tue, 3 Jul 2007 01:23:17 +0200
To: bug-warnings-compat [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Hello Michael, Show quoted text
> On modern perls, warnings::compat will not install itself to avoid > blowing over the real warnings.pm. This is good but I realize > there's a > problem. Since nothing is installed things like the CPAN shell don't > realize that the dependency has been resolved. For each module which > declares a dependency on warnings::compat the CPAN shell will download > and install warnings::compat.
This means you're actually using this module? ;-) Show quoted text
> It should install warnings::compat to indicate its already there and > stop the continual reinstallation. Simply replace the PM line in > Makefile.PL with the following.
Thanks for the patch. It's been applied and with a few other documentation nits I'm making a new release right now. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
Subject: Re: [rt.cpan.org #27908] Install at least warnings::compat so the CPAN shell knows its installed
Date: Mon, 02 Jul 2007 17:02:41 -0700
To: bug-warnings-compat [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
Sébastien Aperghis-Tramoni via RT wrote: Show quoted text
>> On modern perls, warnings::compat will not install itself to avoid >> blowing over the real warnings.pm. This is good but I realize >> there's a >> problem. Since nothing is installed things like the CPAN shell don't >> realize that the dependency has been resolved. For each module which >> declares a dependency on warnings::compat the CPAN shell will download >> and install warnings::compat.
> > This means you're actually using this module? ;-)
Yeah, I was trying out the 5.5.5 alpha Leon just published and couldn't get very far without warnings.pm. I also mentioned it on my journal. http://use.perl.org/~schwern/journal/33664 Show quoted text
>> It should install warnings::compat to indicate its already there and >> stop the continual reinstallation. Simply replace the PM line in >> Makefile.PL with the following.
> > Thanks for the patch. It's been applied and with a few other > documentation nits I'm making a new release right now.
Smashing.
Subject: Re: [rt.cpan.org #27908] Install at least warnings::compat so the CPAN shell knows its installed
Date: Tue, 3 Jul 2007 08:47:07 +0200
To: bug-warnings-compat [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Michael G Schwern wrote: Show quoted text
> Yeah, I was trying out the 5.5.5 alpha Leon just published and > couldn't get > very far without warnings.pm.
Oh that's right. I must also test it with the modules I maintain. Show quoted text
> I also mentioned it on my journal. http://use.perl.org/~schwern/ > journal/33664
I just realise that one the problems that prevented me to use warnings::compat (which is that touching $^W can create warnings in other modules (I had this problem with XML::Tiny)) can be partially resolved by putting a C< no warnings > at the end of the module using it, just before the true value. I'll update the documentation and my talk about it for the next release. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
From: BURAK [...] cpan.org
Btw, I think that bytes & utf8 have more usage than warnings (perl -w && local $^W is more common), so what about those?
Subject: Re: [rt.cpan.org #27908] Install at least warnings::compat so the CPAN shell knows its installed
Date: Tue, 03 Jul 2007 15:01:20 +0200
To: bug-warnings-compat [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Burak Gürsoy wrote: Show quoted text
> Btw, I think that bytes & utf8 have more usage than warnings (perl -w > && local $^W is more common), so what about those?
Er, I think that "use warnings" is much, much more used than utf8 of bytes. A quick Google code search gives me the following results: use warnings => ~104,000 use utf8 => ~500 use bytes => ~400 By the way, bytes.pm would be a no-op on pre-5.6 Perl, so if you really want it, I can upload a bytes::compat. utf8.pm and encoding.pm can probably be faked using Unicode::String. But in both cases, and as for warnings.pm, such faked modules will be poor emulations of the real ones, with the additional problem that people rarely used anything from warnings.pm beyond C<use> while they expect functions from utf8.pm and encoding.pm to work properly. And let's not talk about the fact that some people use the presence of utf8.pm to do random data transformation (hello Graham). » http://rt.cpan.org/Public/Bug/Display.html?id=24835 -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
From: BURAK [...] cpan.org
On Tue Jul 03 09:01:45 2007, SAPER wrote: Show quoted text
> Er, I think that "use warnings" is much, much more used than utf8 of
bytes. Hmmm... Google only lists public code AFAICT. Anyway, lets change the sentence as: "I don't use warnings too much, but use the other two a lot" :) Show quoted text
> By the way, bytes.pm would be a no-op on pre-5.6 Perl, so if you
really Show quoted text
> want it, I can upload a bytes::compat. utf8.pm and encoding.pm can
probably Show quoted text
> be faked using Unicode::String. >
I only use utf8 to mention that the source file is utf8 encoded. Don't use any functions from it (Encode is better for this). And if the file is utf8 (no BOM), then it should work under 5.6.2 & 5.5.4 at least (I've tested this with my Time::Elapsed module under win32). Not sure about implementing utf8.pm methods, but the only thing I need is it's presence. Similarly, I use bytes to calculate the byte size of a string and only need it's presence since older perls are byte oriented :) Show quoted text
> But in both cases, and as for warnings.pm, such faked modules will
be poor Show quoted text
> emulations of the real ones, with the additional problem that people
rarely Show quoted text
> used anything from warnings.pm beyond C<use> while they expect
functions Show quoted text
> from utf8.pm and encoding.pm to work properly. > > And let's not talk about the fact that some people use the presence
of Show quoted text
> utf8.pm to do random data transformation (hello Graham). > » http://rt.cpan.org/Public/Bug/Display.html?id=24835 > > -- > Sébastien Aperghis-Tramoni > > Close the world, txEn eht nepO.
Subject: Re: [rt.cpan.org #27908] Install at least warnings::compat so the CPAN shell knows its installed
Date: Wed, 4 Jul 2007 02:12:21 +0200
To: bug-warnings-compat [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Burak Gürsoy via RT wrote: Show quoted text
> On Tue Jul 03 09:01:45 2007, SAPER wrote:
>> Er, I think that "use warnings" is much, much more used than utf8 >> or bytes.
> > Hmmm... Google only lists public code AFAICT.
Yes, but this includes the CPAN, which is a very good sample of Perl modules and programs, written by more programmers than each of us know. Show quoted text
> Anyway, lets change the sentence as: "I don't use warnings too > much, but use the other two a lot" :)
This is a very different problem :-) Show quoted text
>> By the way, bytes.pm would be a no-op on pre-5.6 Perl, so if you >> really want it, I can upload a bytes::compat. utf8.pm and encoding.pm >> can probably be faked using Unicode::String.
> > I only use utf8 to mention that the source file is utf8 encoded. Don't > use any functions from it (Encode is better for this). And if the file > is utf8 (no BOM), then it should work under 5.6.2 & 5.5.4 at least
utf8.pm under 5.005_04? Does this means that you have already made a backport of it? $ corelist utf8 utf8 was first released with perl 5.006 Show quoted text
> (I've tested this with my Time::Elapsed module under win32). Not sure > about implementing utf8.pm methods, but the only thing I need is it's > presence. Similarly, I use bytes to calculate the byte size of a > string and only need it's presence since older perls are byte > oriented :)
Well, looking at what bytes.pm provides (I have never used it), it really is trivial to backport it. I'll take a look to this when I'll have more time. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
From: BURAK [...] cpan.org
On Tue Jul 03 20:12:59 2007, SAPER wrote: Show quoted text
> utf8.pm under 5.005_04? Does this means that you have already made
a Show quoted text
> backport of it? >
No :) I mean: "use utf8" is needed for BOM-less utf8 source files under $] >= 5.008 and 5.6 already has it, but if I by-pass it via something like BEGIN { $INC{'utf8.pm'} = 1; ... } the returned values are not affected and displayed correctly under 5.5.4. So, if only a bare "use utf8" is needed, an empty file will be enough to fake it (for me at least) I'm not so sure about the possibility of faking utf8:: methods though... Show quoted text
> > Well, looking at what bytes.pm provides (I have never used it), it > really is trivial to backport it. > I'll take a look to this when I'll have more time. >
ok :)
Subject: Re: [rt.cpan.org #27908] Install at least warnings::compat so the CPAN shell knows its installed
Date: Mon, 9 Jul 2007 08:59:20 +0200
To: bug-warnings-compat [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Burak Gürsoy wrote: Show quoted text
>> utf8.pm under 5.005_04? Does this means that you have already made >> a backport of it?
> > No :) I mean: "use utf8" is needed for BOM-less utf8 source files > under $] >= 5.008 and 5.6 already has it, but if I by-pass it via > something like BEGIN { $INC{'utf8.pm'} = 1; ... } the returned values > are not affected and displayed correctly under 5.5.4. So, if only a > bare "use utf8" is needed, an empty file will be enough to fake it > (for me at least) I'm not so sure about the possibility of faking > utf8:: methods though...
Well, if you allow me to put this in a very straightforward way, I don't work for you, but either for me of for everybody :-) So in cases such as providing backward compatible versions of pragams/ modules like warnings.pm, bytes.pm, utf8.pm, encoding.pm, I want them to be as complete and transparent as possible. Plus, I think that you don't need me if "echo 1 >utf8.pm" is enough for you :-) -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.