G'day Intrepid,
I'm a long time user of Cygwin for both personal and $work tasks. I currently have (running on Win10):
ken@titan ~/tmp $ uname -a CYGWIN_NT-10.0-19045 titan 3.6.1-1.x86_64 2025-04-09 11:31 UTC x86_64 +Cygwin
I update Cygwin weekly which typically takes just a few minutes; updating infrequently can take hours -- obviously, I'd recommend the former. The last update that I did was less than 12 hours ago and there were multiple pages of perl-* packages (this still only took some minutes).
I never use the system perl (/usr/bin/perl) except for tests such as those that follow; I do use Perlbrew which I heartily recommend.
I don't know why you quoted -Mdiagnostics. It seems superfluous but maybe you had a reason. I've used quoted and unquoted versions in the examples below.
I can't reproduce your error. I rarely use the diagnostics pragma but don't recall ever having encountered problems with this.
Here's my normal and system perls:
ken@titan ~/tmp $ perl -v | head -2 | tail -1 This is perl 5, version 40, subversion 0 (v5.40.0) built for cygwin-th +read-multi $ which perl /home/ken/perl5/perlbrew/perls/perl-5.40.0/bin/perl $ /usr/bin/perl -v | head -2 | tail -1 This is perl 5, version 40, subversion 2 (v5.40.2) built for x86_64-cy +gwin-threads-multi
Here's @INC for both:
ken@titan ~/tmp $ perl -E 'say for @INC' /home/ken/perl5/perlbrew/perls/perl-5.40.0/lib/site_perl/5.40.0/cygwin +-thread-multi /home/ken/perl5/perlbrew/perls/perl-5.40.0/lib/site_perl/5.40.0 /home/ken/perl5/perlbrew/perls/perl-5.40.0/lib/5.40.0/cygwin-thread-mu +lti /home/ken/perl5/perlbrew/perls/perl-5.40.0/lib/5.40.0 $ /usr/bin/perl -E 'say for @INC' /usr/local/lib/perl5/site_perl/5.40/x86_64-cygwin-threads /usr/local/share/perl5/site_perl/5.40 /usr/lib/perl5/vendor_perl/5.40/x86_64-cygwin-threads /usr/share/perl5/vendor_perl/5.40 /usr/lib/perl5/5.40/x86_64-cygwin-threads /usr/share/perl5/5.40
Here's examples of your "Simplest test case":
ken@titan ~/tmp $ perl '-Mdiagnostics' -le 'print $diagnostics::VERSION' 1.40 $ perl -Mdiagnostics -le 'print $diagnostics::VERSION' 1.40 $ /usr/bin/perl '-Mdiagnostics' -le 'print $diagnostics::VERSION' 1.40 $ /usr/bin/perl -Mdiagnostics -le 'print $diagnostics::VERSION' 1.40
If you're installing modules on the system perl, you may have inadvertently broken something in the past.
I don't know enough about your system to offer advice beyond update Cygwin and use Perlbrew. Sorry if that's not particularly helpful for this specific problem. Good luck with your troubleshooting.
— Ken
In reply to Re: diagnostics pragma throwing a compile-time error in Cygwin-Perl
by kcott
in thread diagnostics pragma throwing a compile-time error in Cygwin-Perl
by Intrepid
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |