DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 62Q7GYuw2093433 Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 62Q7GYuw2093433 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=nHR7qIYb X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C2CA94BA2E14 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1774509392; bh=Zma7f74BvAh34lORy4mjOpuUEfHFZz9JafkDhT2Ju1M=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=nHR7qIYbGckptMRaaFNX0jUQ4lNyRGO4UHAuHLyxduZLMMPshiQiCnhZOUnTI+myD YgFbMVpR/0PIE4j7tta4kU38ZsoN8TFucTvuX3W9Jw2ciIPaNDXFaEL8sF2kqNNKdd 53jNQ6ewpA8/+z5dbbOksIsqy6TvfBqlONEe2g8A= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 471F14BA2E10 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 471F14BA2E10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1774509372; cv=none; b=ZvTX4+RvlBAQM4HdiTc/Ugo1mtrcMJgC9tjuKzWUf/nTl9sf3OqzvSbfUAtgnegg8jMq6eumr7U54gqf+/0aaHAp90q+OJZ1aGzueP7VpqWM5H2rMOgjv9S97LoarAINrdhoBoc/olvUH/dF4nhp1B7p+ipJdFwuLD1jIHtvrBE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1774509372; c=relaxed/simple; bh=p4GMuj116UWAR+RI0//dDKEsFL4DG7YcWow2t2GotGg=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=gMy6sKGaIZ28FLihT8HQcRW98IFgLOQvbTUDTKgZdUyOdVN7WUW35USsKMcNQpTO9x3h5t6JJ6+Vm8YlpvVBuJ1leiquibv/mYaYaFm37tKmZHkQWHGFyVcGtlFcKSTurbpXub2333iP8Uz5DbBDaAOGSOq3Yr1JTx+csMCWcDU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 471F14BA2E10 Date: Thu, 26 Mar 2026 07:16:09 +0000 To: Soren via Cygwin Subject: cygchk-perl-mods.pl (Was: An offering to the Perl enthusiasts . Message-ID: Mail-Followup-To: Soren via Cygwin References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.14 (2025-02-20) X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Dr Bean via Cygwin Reply-To: Dr Bean Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" On Tue, 24 Mar 2026, Soren via Cygwin wrote: > Greetings cygwinistas. > I've written a program in Perl that satisfies a desire I've had for a > while. I wanted to have a way to check out what Perl module distributions > have been made into cygwin packages installable with Setup, but outside of > Setup. The main feature of how the program works is the specification of > "namespace globs" like "IO-*" or "Module-*" used as the argument to my > script. This allows for surveying a manageable grouping of packages from > the Cygwin server, in the TMI (terminal, text mode interface, commandline). > I think it's best if I just show some representative output rather than > struggling to explain what I mean: > $ perl ~/Scripts-working/cygchk-perl-mods.pl 'perl-Module-*' > Matching distributions packaged for Cygwin: > Fetching setup.ini from cygwin.com... > perl-Module-Build Module::Build is installed as > /usr/local/share/perl5/site_perl/5.40/Module/Build.pm > perl-Module-Build-Tiny Module::Build::Tiny is installed as > /usr/local/share/perl5/site_perl/5.40/Module/Build/Tiny.pm > perl-Module-Build-XSUtil Module::Build::XSUtil is installed as > /usr/local/share/perl5/site_perl/5.40/Module/Build/XSUtil.pm > perl-Module-Implementation Module::Implementation is installed as > /usr/local/share/perl5/site_perl/5.40/Module/Implementation.pm > perl-Module-Install Module::Install is installed as > /usr/local/share/perl5/site_perl/5.40/Module/Install.pm > perl-Module-Metadata Module::Metadata is installed as > /usr/share/perl5/5.40/Module/Metadata.pm > perl-Module-Pluggable Module::Pluggable is installed as > /usr/local/share/perl5/site_perl/5.40/Module/Pluggable.pm > perl-Module-Runtime Module::Runtime is installed as > /usr/local/share/perl5/site_perl/5.40/Module/Runtime.pm > perl-Module-ScanDeps Module::ScanDeps is installed as > /usr/local/share/perl5/site_perl/5.40/Module/ScanDeps.pm > perl-Module-Signature Module::Signature is not installed > That's how it produces output. The point of this is twofold. One is that > there are hundreds of packaged modules in Setup and I find myself squinting > and getting a headache if I just try to scroll through the huge list that > matches "perl-". The other point is that the output allows me to check > whether I've built a module from CPAN and perl has installed it under > "site_perl/" (which has the consequence that it has precedence over modules > installed to "vendor_perl/" [which is called "shadowing"]). > I could possibly add features to this program: displaying the version of > the module installed would be one nice thing. But I believe in the unix > virtue of "small tools that do one thing well" (and I am a bit busy, yeah) > and so for now I'll avoid feeping creaturism and just show y'all the script: > (If you prefer to download rather than c&p I've made a gist for it at > https://gist.github.com/somian/22f6d1baae1b44c6c1e0cb0ea867e0a5) > #!/usr/bin/perl > # Last modified: Tue Mar 24 11:57:45 2026 > use strict; > use v5.18; > use utf8; > use warnings; > use Carp qw/ carp croak /; > =head1 NAME > cygchk-perlmods.pl > =head1 SYNOPSIS > cygchk-perlmods.pl "IO-*" # "glob expression" > =head1 VERSION > 0.10 > =head1 AUTHOR > Soren Andersen C > =cut > if ( @ARGV * 1 == 0 ) { > croak 'You must type an argument. Exiting.'; > } > my ($globexpr) = @ARGV; > my $as_perl_says; > if ($globexpr !~/^perl-/) { # you may omit the "perl-" prefix in the > argument > $globexpr = 'perl-' . $globexpr; > } > $globexpr = lc $globexpr; > open( my $ok_fh, '-|', "cygcheck", "-e", $globexpr); > croak "Dying from no open on cygcheck" unless $ok_fh; > printf( "Matching distributions packaged for Cygwin:\n" ); > my ( @dists, $mlen ); > $mlen = 0; > while (<$ok_fh>) { > my $setup_name = $_; > my $nonly = (split( ' : ' ))[0]; > $mlen = length($nonly) > $mlen ? length($nonly) : $mlen; > push @dists, $nonly; > } > for (@dists) { > my $e = substr($_,5); > $e =~s/-/::/g; > $as_perl_says = $e; > my $report_str = sprintf( "%-${mlen}s %s" => > $_, $as_perl_says ); > $report_str .= q[ ].chk_inst( $as_perl_says ); > say $report_str; > } > sub chk_inst { > local $::pkgname = $_[0]; > eval qq{require $::pkgname;}; > unless ( $@ ) { > my $pm = $_[0]; > $pm =~ s{::}{/}g; > $pm .= '.pm'; > return 'is installed as '. $INC{ $pm }; > } else { > return 'is not installed'; > } > } > __END__ > =head1 LICENSE > This program is Free software, made available under the same terms as Perl. > THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR > IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED > WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. > =cut > # vim: ft=perl et sw=4 ts=4 : I tried running this over a few outer package names in my system perl and perl environment manager perlbrew installations to see what was different in both. I can see this also being of use in attempts to stick to tested cygwin perl packages and avoid taking chances with the 'latest and greatest' from CPAN. The script doesn't show shadowed (hidden) modules (from cygwin packages) in vendor_perl (?) if there is one downloaded from CPAN in /usr/local/share/...? CPAN modules may also be stored in /usr/share/perl5/.../site-perl? I can see my Module::Build appears to have been installed from CPAN, but Module::Build::Tiny appears to have come from a cygwin package. That doesn't seem ideal. But is it no problem? I can imagine the reason for source differences is a CPAN module I downloaded wanted a more recent version than the cygwin package provided. But I am grateful that using perl in cygwin is well-ordered compared with the unavoidability of virtual environments in python, rendering system python irrelevant. A compare-and-contrast tool like this for python virtual environments I could see being of use. I will keep this around for use figuring out perl dependency problems when not using perlbrew. It is not in a github or other foundry repo? -- Greg "Dr Bean" Matheson If there is one thing we learn from http://drbean.sdf.org studying learners, it is that drbean AT freeshell DOT org they learn more than we learn. -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple