Skip Menu |

This queue is for tickets about the Module-Load-Conditional CPAN distribution.

Report information
The Basics
Id: 83728
Status: resolved
Worked: 50 min
Priority: 0/
Queue: Module-Load-Conditional

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

Bug Information
Severity: Normal
Broken in: 0.54
Fixed in: (no value)



Subject: requires() function reports funny things if module prints to STDOUT
If you use requires() to get dependencies for a module which prints things to stdout, for example in an END block, then you'll get confusing results. And if the module is one of the other modules for getting dependencies, then you might get modules listed twice, or some slightly interesting output. Eg @deps = requires('Devel::Loaded'); foreach my $module (@deps) { print " $module\n"; } Which results in: ::usr::local::lib::perl5::5.16.2::darwin-2level::File::Spec ::usr::local::lib::perl5::5.16.2::darwin-2level::File::Spec::Unix ::usr::local::lib::perl5::5.16.2::strict ::usr::local::lib::perl5::5.16.2::vars ::usr::local::lib::perl5::5.16.2::warnings::register ::usr::local::lib::perl5::site_perl::5.16.2::Devel::Loaded Devel::Loaded.pm::usr::local::lib::perl5::5.16.2::warnings File::Spec File::Spec::Unix strict vars warnings warnings::register My first thought for a solution is very hacky: in the sub-process, once you've printed the modules, you could close(STDOUT); I know, I know, but it does work ;-) And possibly reopen it to /dev/null (um, portably of course), to stop anything barfing.
Many thanks, this has been resolved with CPAN release 0.56
From: paul [...] city-fan.org
On Thu Aug 29 16:35:04 2013, BINGOS wrote: Show quoted text
> Many thanks, this has been resolved with CPAN release 0.56
The fix for this uses a function prototype of "_", which implies a minimum perl version of 5.10.0 (http://perldoc.perl.org/perl5100delta.html#The-_-prototype); was that intended?
Subject: Re: [rt.cpan.org #83728] requires() function reports funny things if module prints to STDOUT
Date: Sat, 31 Aug 2013 23:02:48 +0100
To: "paul [...] city-fan.org via RT" <bug-Module-Load-Conditional [...] rt.cpan.org>
From: "Chris 'BinGOs' Williams" <chris [...] bingosnet.co.uk>
On Sat, Aug 31, 2013 at 03:23:37PM -0400, paul@city-fan.org via RT wrote: Show quoted text
> Queue: Module-Load-Conditional > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=83728 > > > On Thu Aug 29 16:35:04 2013, BINGOS wrote:
> > Many thanks, this has been resolved with CPAN release 0.56
> > The fix for this uses a function prototype of "_", which implies a minimum perl version of 5.10.0 (http://perldoc.perl.org/perl5100delta.html#The-_-prototype); was that intended?
That certainly wasn't my intention, I needed a way for a function to take $_ if no arguments were provided. Is there a way of doing that without using the _ prototype? Cheers, -- Chris Williams aka BinGOs PGP ID 0x4658671F http://www.gumbynet.org.uk ==========================
Download (untitled)
application/pgp-signature 189b

Message body not shown because it is not plain text.

RT-Send-CC: paul [...] city-fan.org
On Sat Aug 31 18:03:08 2013, chris@bingosnet.co.uk wrote: Show quoted text
> On Sat, Aug 31, 2013 at 03:23:37PM -0400, paul@city-fan.org via RT > wrote:
> > Queue: Module-Load-Conditional > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=83728 > > > > > On Thu Aug 29 16:35:04 2013, BINGOS wrote:
> > > Many thanks, this has been resolved with CPAN release 0.56
> > > > The fix for this uses a function prototype of "_", which implies a > > minimum perl version of 5.10.0 > > (http://perldoc.perl.org/perl5100delta.html#The-_-prototype); was > > that intended?
> > That certainly wasn't my intention, I needed a way for a function to > take $_ if no arguments were provided. > Is there a way of doing that without using the _ prototype? > > Cheers,
Just released 0.58 to CPAN which resolves the issue. Tested with perl v5.6.2, amongst others. Many thanks.