Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: Can't close pipe to invalid process

by aitap (Curate)
on Aug 29, 2015 at 19:38 UTC ( #1140406=note: print w/replies, xml ) Need Help??


in reply to Re^2: Can't close pipe to invalid process
in thread Can't close pipe to invalid process

Correct me if I'm wrong, but OP said:

Turns out it was because the PATH didn't exist in the Jenkins environment.
Why would the open succeed to an unknown executable?
As far as I understood OP, missing PATH meant that the script was unable to run executables except by full path:
$ env LC_ALL=C PATH="" /usr/bin/perl -E'open my $fh, "-|", $_ and say +"success" or say $! for "ls", "/bin/ls"' No such file or directory success
So the question was: how does open succeed despite inability to find the executable due to empty $PATH?

By the way, thanks for the spelling reminder.

Replies are listed 'Best First'.
Re^4: Can't close pipe to invalid process
by BrowserUk (Pope) on Aug 29, 2015 at 19:59 UTC

    The only path I see in the OP is that pointing to the file the executable is meant to process:

    /opt/humana/svn/checkouts/rosalind-repo/prod/tmp/testfile.pdf

    The executable name is provided unadorned; so either in the current working directory or to be located via the path environment variable.

    But, as I've no knowledge of what the "Jenkins environment" is; it could be me misinterpreting the question.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
    In the absence of evidence, opinion is indistinguishable from prejudice.
    I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!
      I was talking about prince. Since (as OP found out) Jenkins had cleared PATH environment variable, and (supposedly) there was no prince executable in the current directory (or the script was running on a UNIX-like system where executables are not run from current directory unless $PATH contains .), OP thought that open($fh, "|-", "prince ...") should have failed, but it didn't because there was a $Config{sh} between Perl and prince in the process tree.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1140406]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (13)
As of 2018-07-16 12:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (334 votes). Check out past polls.

    Notices?