CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
External program help !

 



zoomer003
Novice

Jun 10, 2010, 1:17 PM

Post #1 of 6 (1786 views)
External program help ! Can't Post

 
im very new to programming and very very new to perl ...

its jus that im designing an automation for my company and its not coming out that good .. my next task is to control and external program with my automation! well i can open up the program through

(
print "Please select the file: ";
chomp ($simfile = <>);
@simplex = ('C:\Program Files\Spirent Communications\SimPLEX\simplex.exe', $simfile);
system(@simplex) == 0 or die "system @simplex failed: $?";
)

but the thing is the program doesnt go any furthur than this i m having a hard time controling it


Bianca
User

Jun 10, 2010, 11:22 PM

Post #2 of 6 (1759 views)
Re: [zoomer003] External program help ! [In reply to] Can't Post

if i use system() I make it so:

Code
my $ret = system ($command); 
if ($ret == -1) {
error ("error $!<");
}
elsif ($ret & 127) {
error (sprintf "process terminated with code %d , %s coredump",($ret & 127), ($ret & 128) ? 'with' : 'without');
}
elsif ($ret) {
error ("System command doesnt return 0");
}
else {
print "OK\n";
}
sub error {
print "Error $_[0]!\n";
exit ();
}



rovf
Veteran

Jun 11, 2010, 1:47 AM

Post #3 of 6 (1756 views)
Re: [zoomer003] External program help ! [In reply to] Can't Post


Quote
the program doesnt go any furthur than this i m having a hard time controling it


Sorry, but this is not quite understandable. We all have a hard time sometimes, after all. What does it mean to have a "hard time to control"??? And, why should your program go "any further" than what you have posted, since this seems to be the last statement in your program anyway?

Also for the safe side (since you didn't say which Perl version you are using) it would be worth setting

$|=1


zoomer003
Novice

Jun 11, 2010, 7:29 AM

Post #4 of 6 (1748 views)
Re: [rovf] External program help ! [In reply to] Can't Post

i am using 5.10 and i meant to say .. after i run the program with the code that presented above .... it opens the program perfectly and opens up the scenerio i wana run .. BUT!!!!! .. i also want to control, wat the scenerio does.

For instance:
i want to control when to run the scenerio and when to stop it i also want to control the power level of the gps signals.

and i have NO CLUE how to do it .. except opening it up.


FishMonger
Veteran / Moderator

Jun 11, 2010, 7:53 AM

Post #5 of 6 (1744 views)
Re: [zoomer003] External program help ! [In reply to] Can't Post

You won't be able to control the app unless they provide an API (Application Programming Interface), which allows you that access.


rovf
Veteran

Jun 14, 2010, 2:04 AM

Post #6 of 6 (1731 views)
Re: [zoomer003] External program help ! [In reply to] Can't Post

I don't know the program you are wanting to "control", but how do you control it when you are NOT using Perl?

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives