Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Help with exec and error message I am getting.

by basicdez (Pilgrim)
on Dec 21, 2001 at 02:46 UTC ( #133645=perlquestion: print w/replies, xml ) Need Help??

basicdez has asked for the wisdom of the Perl Monks concerning the following question:

If any of you kind so kind monks could please point me in the right direction, that would be awesome.

when I put in the following code...

#!/usr/bin/perl-Tw use strict; exec ('/opt/BIPSConnect/bin/rdes') or print STDERR "Couldn't exec prog +ram: $!";
I end up with this message, and I can run it from the command prompt in this directory or any other directory by typing in /opt/BIPSConnect/bin/rdes, so I am way confused.
/opt/BIPSConnect/bin/rdes: LD_LIBRARY_PATH=:/usr/lib:/usr/ucblib:/usr/ +openwin/lib:/usr/dt/lib:/usr/local/lib:/opt/hpnpl/lib:/p01cfg0 1/harvest/Harvest/lib:/opt/BIPSConnect/bin: is not an identifier
I am not understanding this at all.

peace, LOVE and ((code))

basicdez

Replies are listed 'Best First'.
Re: Help with exec and error message I am getting.
by Fastolfe (Vicar) on Dec 21, 2001 at 03:12 UTC

    Assuming the perl-Tw bit is a typo, I would check to see if /opt/BIPSConnect/bin/rdes is a shell script, and if so, whether it's written for a particular shell and just isn't declaring this on the first #! line. It's possible that the shell this was intended for is the shell you're using, but Perl's exec (and/or the system's execvp()) function is running it under a different one.

    I'm just making guesses here, though. There's not a lot of information here to go on.

      What rdes is is a C program that I need to call from within Perl. How do I do that?

      peace, LOVE and ((code))

      basicdez

        I'm lost at this point. If 'rdes' is a C program (which I'm assuming you mean it was a program written in C and then compiled to a binary executable for your system), then I don't know what else you could try. I'm a bit confused about your message to me privately, though, where you said you added the shebang line with no effect. If this is a binary executable, a "shebang" line is not desired, and would have corrupted the executable (assuming your editor let you edit it at all). Since you reported no change in your findings, something is not as you say.

        Regardless, I don't think this is a Perl problem. Contact your system administrator and/or the vendor for this 'rdes' program.

Re: Help with exec and error message I am getting.
by VSarkiss (Monsignor) on Dec 21, 2001 at 03:06 UTC

    Hmm... It looks like your shebang line is broken. You need a space between "perl" and "-Tw". Since there's no program "perl-Tw", I'm guessing whatever system you're on is calling the shell, which is then trying to exec that rdes program with the long path.

    Try fixing the shebang and see if it goes away. Unless, of course, that was just a copy-and-paste artifact, in which case you should ignore this reply altogether. ;-)

    HTH

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2022-01-21 11:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (57 votes). Check out past polls.

    Notices?