51 users online (0 members and 51 guests)  


  Results 1 to 3 of 3

Related

  1. Running external program from CGI/Perl    Forum: CGI Perl Forum
    Replies: 2
  2. Remote program execution using cgi-perl    Forum: CGI Perl Forum
    Replies: 1
  3. Replies: 1
  1. #1
    rosefern's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2006
    Posts
    1

    Exclamation Execute external program in perl/cgi

    Hi,
    I want to execute an external program within perl and return its execution status to the calling perl program.
    I've tried the below two methods but none seem to be working.
    1.$status =system "http://www.abc.com/xyz.pl";
    2.$status =`http://www.abc.com/xyz.pl`;

    Please advise how to get the problem solved.
    Thanks,

  2. #2
    cdlvj's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2006
    Posts
    2

    Re: Execute external program in perl/cgi

    Quote Originally Posted by rosefern
    Hi,
    I want to execute an external program within perl and return its execution status to the calling perl program.
    I've tried the below two methods but none seem to be working.
    1.$status =system "http://www.abc.com/xyz.pl";
    2.$status =`http://www.abc.com/xyz.pl`;

    Please advise how to get the problem solved.
    Thanks,
    Your Internet server needs to be configured correctly. Is this a cgi script? They need to be in a special protected place, otherwise anyone could breach your system.

  3. #3
    pageBuzz.com's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2006
    Posts
    21

    Re: Execute external program in perl/cgi

    rosefern - If your cgi program does nothing more than return a result just use:

    require '/pathtocgi/xyz.pl';

    then your program will run as a sub of the main program.

    if your program returns a variable you can use that variable in the current program, or pass variables from the main program to the xyz.pl