Calling a perlscript within a another script in a loop

Reply

Join Date: Jun 2009
Posts: 10
Reputation: Prakash_8111 is an unknown quantity at this point 
Solved Threads: 0
Prakash_8111 Prakash_8111 is offline Offline
Newbie Poster

Calling a perlscript within a another script in a loop

 
-1
  #1
Aug 12th, 2009
Hey Guys,

Have u any Idea how to call a perl script within my main script in a loop.
I used system and exec both, but it seems to be not working. I want the second calling of the script shouldn't depend on the first calling.... all should run independently............
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 15
Reputation: wickedxter is an unknown quantity at this point 
Solved Threads: 0
wickedxter wickedxter is offline Offline
Newbie Poster

Re: Calling a perlscript within a another script in a loop

 
0
  #2
Aug 13th, 2009
you can try this: open the file, slurp it all in at once and use eval to execute the code.
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 898
Reputation: KevinADC has a spectacular aura about KevinADC has a spectacular aura about 
Solved Threads: 67
KevinADC's Avatar
KevinADC KevinADC is offline Offline
Practically a Posting Shark

Re: Calling a perlscript within a another script in a loop

 
0
  #3
Aug 14th, 2009
Calling another perl script in a loop should not be difficult but the last part of your question makes no sense to me.

I want the second calling of the script shouldn't depend on the first calling.... all should run independently............
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 10
Reputation: Prakash_8111 is an unknown quantity at this point 
Solved Threads: 0
Prakash_8111 Prakash_8111 is offline Offline
Newbie Poster

Re: Calling a perlscript within a another script in a loop

 
0
  #4
Aug 14th, 2009
I am calling the script as exec(called_script.pl, arg1), its calling first time , second execution is not going, it is killing the main process. My second question refers all the time loop increases it should run another instance of the script. Ok can u just tell how to call the script in a loop. Thanks in advance
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 898
Reputation: KevinADC has a spectacular aura about KevinADC has a spectacular aura about 
Solved Threads: 67
KevinADC's Avatar
KevinADC KevinADC is offline Offline
Practically a Posting Shark

Re: Calling a perlscript within a another script in a loop

 
0
  #5
Aug 14th, 2009
I guess you didn't read what exec() does.

The exec function executes a system command and never returns-- use system instead of exec if you want it to return
http://perldoc.perl.org/functions/exec.html

As they say on forums: Read the manual

If you want to run multiple instances of a perl program I think you will want to use threads. Not something I have experience with though:

http://search.cpan.org/~jdhedden/thr....74/threads.pm
Last edited by KevinADC; Aug 14th, 2009 at 1:43 pm.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 49
Reputation: onaclov2000 is an unknown quantity at this point 
Solved Threads: 5
onaclov2000 onaclov2000 is offline Offline
Light Poster

Re: Calling a perlscript within a another script in a loop

 
0
  #6
Aug 17th, 2009
I know i've used print `command`; as well with varied success.
My Blog:
Onablog
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC