Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Perl::Critic and the POSIX module.

by cavac (Parson)
on Jan 26, 2022 at 18:10 UTC ( [id://11140886]=note: print w/replies, xml ) Need Help??


in reply to Perl::Critic and the POSIX module.

What operating system and version are you on? Do you use the perl interpreter installed by your OS or did you compile it yourself?

Also, and this might be a stupid question, POSIX::setsid() actually work on your particular installation? I haven't looked into it for more than a few minutes, but it looks like the POSIX module does all kind of weird dynamic stuff on compile time (and probably on runtime as well) depending on your OS. For example, the Makefile.PL is full of stuff like this:

if ($^O ne 'MSWin32' && $^O ne 'freemint') { push @libs, qw(m posix cposix); }

And even the .pm files have some nice stuff like:

strerror  => 'errno => BEGIN { local $!; require locale; locale->import} my $e = $_[0] + 0; local $!; $! = $e; "$!"',

or

if ($^O eq 'MSWin32') { $default_export_tags{winsock_h} = [qw(

The astonishing thing here isn't that perlcritic has a hickup with stuff like that. It's astonishing that perlcritic gets it right more often than not under circumstance that are essentially "the module exports A B and C unless it is a full moon or the wind comes from the northeast, in which case the exports are A D and C and if you change the order of the exports the thing will instantly collapse into a black hole and take your project with it".

perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'

Replies are listed 'Best First'.
Re^2: Perl::Critic and the POSIX module.
by syphilis (Archbishop) on Jan 27, 2022 at 01:58 UTC
    Do you use the perl interpreter installed by your OS or did you compile it yourself?

    Yes, that could be part of the problem.
    It looks to me that /usr/bin/perl is being invoked to run "test.pl" ... I don't know which perl could be running "perlcritic".

    One other thing I notice is the OP doesn't explicitly state that the POSIX module does, in fact, export "setsid".
    For example, on Windows, "setsid" is not implemented, let alone exported.
    However, Perl::Critic doesn't build for me on Windows, so I don't get to see how the command perlcritic --stern ./test.pl reacts to that "test.pl" file on WIndows.

    Cheers,
    Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11140886]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2024-04-18 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found