Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

(I have made this a reply to your original post; to continue the original thread would have indented too far for my taste)

I can run this at the prompt, but putting in the following, /opt/BIPSConnect/bin/rdes, but when I put it in perl code (here is what I am trying to do - Quite simple and nothing complex, until I get this working) ...
#!/usr/bin/perl-Tw use strict; my $cmd_to_run = "/opt/BIPSConnect/bin/rdes"; my @results = `$cmd_to_run`;
I get the following error... /opt/BIPSConnect/bin/rdes: LD_LIBRARY_PATH=:/usr/lib:/usr/ucblib:/usr/openwin/lib:/usr/dt/lib:/usr/local/lib:/opt/hpnpl/lib:/p01cfg01/harvest/Harvest/lib:/opt/BIPSConnect/bin: is not an identifier

Okay, this is obviously a UNIX (not DOS/Windows) platform, so that eliminates an entire subspecies of problems.

I notice you are running your perl script with taint mode (-T). Are you, by chance, running it setuid, as well? In setuid mode Solaris (under which you appear to be running) closes the executable file and reopens it such that the program sees /dev/fd4 (or fd5, ...) instead of the name of the actual executable as $0, among other things. In taint mode Perl's behavior apropos the environment is somewhat different as well; certain specific variables must be set to known "safe" values (PATH and LD_LIBRARY_PATH come to mind, for example). Take a look at Perl security for more on this topic.

Update: Is it possible that the message you're seeing has something to do with trying to use the Bourne shell syntax,

[ENVVAR=value ...] command

with csh or tcsh, which do not permit this? What is your default shell?

Just asking ...

dmm


In reply to Re: Running a C Program within Perl. by dmmiller2k
in thread Running a C Program within Perl. by basicdez

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-04-20 02:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found