Skip Menu |

This queue is for tickets about the App-find2perl CPAN distribution.

Report information
The Basics
Id: 110580
Status: open
Priority: 0/
Queue: App-find2perl

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

Bug Information
Severity: (no value)
Broken in: 1.003
Fixed in: (no value)



Subject: Tarball should contain a (dummy) App::find2perl
Currently doing cpan App::find2perl would install find2perl on every run, because there's no App::find2perl which is installed, and CPAN.pm determines if it has to install anything by doing a version check on the specified module. It's either not possible to use CPAN.pm on the script name, and using the distribution name for the installation means one has to hardcode or track the current latest version of the distribution. Best is to provide a dummy App::find2perl here. Maybe even better it would be to move the code from find2perl to this new module, and make it possible to use this functionality from perl scripts and modules directly, not via find2perl. Regards, Slaven
Subject: Re: [rt.cpan.org #110580] Tarball should contain a (dummy) App::find2perl
Date: Thu, 24 Dec 2015 22:11:03 +0100
To: bug-App-find2perl [...] rt.cpan.org
From: Leon Timmermans <leont [...] cpan.org>
On Thu, Dec 24, 2015 at 10:13 AM, Slaven_Rezic via RT < bug-App-find2perl@rt.cpan.org> wrote: Show quoted text
> Currently doing > > cpan App::find2perl > > would install find2perl on every run, because there's no App::find2perl > which is installed, and CPAN.pm determines if it has to install anything by > doing a version check on the specified module. > > It's either not possible to use CPAN.pm on the script name, and using the > distribution name for the installation means one has to hardcode or track > the current latest version of the distribution. > > Best is to provide a dummy App::find2perl here.
I hadn't thought about that aspect, but yes that makes sense. I should probably do the same for App::s2p. Show quoted text
> Maybe even better it would be to move the code from find2perl to this new > module, and make it possible to use this functionality from perl scripts > and modules directly, not via find2perl. >
Yeah, that would be great. I'd gladly hand it over to someone who was invested enough to actually do that. Leon
On 2015-12-24 16:11:32, LEONT wrote: Show quoted text
> On Thu, Dec 24, 2015 at 10:13 AM, Slaven_Rezic via RT < > bug-App-find2perl@rt.cpan.org> wrote: >
> > Currently doing > > > > cpan App::find2perl > > > > would install find2perl on every run, because there's no > > App::find2perl > > which is installed, and CPAN.pm determines if it has to install > > anything by > > doing a version check on the specified module. > > > > It's either not possible to use CPAN.pm on the script name, and using > > the > > distribution name for the installation means one has to hardcode or > > track > > the current latest version of the distribution. > > > > Best is to provide a dummy App::find2perl here.
> > > I hadn't thought about that aspect, but yes that makes sense.
https://github.com/Leont/app-find2perl/pull/3 Show quoted text
>
> > Maybe even better it would be to move the code from find2perl to this > > new > > module, and make it possible to use this functionality from perl > > scripts > > and modules directly, not via find2perl. > >
> > Yeah, that would be great. I'd gladly hand it over to someone who was > invested enough to actually do that.
How could this look like? use App::find2perl qw(find2perl); $perlcode = find2perl($dir, -opt => $val ...); # return perl string @files = eval $perlcode; or $sub = find2sub($dir, -opt => $val ...); # return result already eval'd into a anon sub @files = $sub->(); -print and -print0 is probably non useful within a perl script, so there should be probably a default of just collecting and returning the visited files. Otherwise there's -eval available. And additionally to the -eval option there could be a -sub option for specifying an anon sub to avoid excessive eval'ing here. But currently I am OK with just the simple dummy module.