Sponsored Content
Top Forums Shell Programming and Scripting Perl Background Process - Finshed Yet? Post 302145665 by Yogesh Sawant on Thursday 15th of November 2007 01:14:58 AM
Old 11-15-2007
for finer control over processes, check out Proc::Simple
Please note that sub calc () is a subroutine, and not a process.

If you are calling this subroutine from some other place, then the regular behavior is what you have described:
Code:
#!/usr/bin/perl
# sub_trial.pl
use strict;
sub calc ()
{
    print "in calc() now ... \n";
    sleep 10;  # wait for 10 seconds
      # or do something here
}
print "we're in main script ... \n";
calc ();
print "and continued ... \n";

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

capture the process id when starting a background process

Hello all, How do I start a background process and save the process id to a file on my system. For example %wait 5 & will execute and print the process id. I can't figure out how to get it to a file. I've tried: > filename 0>filename 1>filename. Any assistance is most appreciated. Thanks, Jim... (10 Replies)
Discussion started by: jleavitt
10 Replies

2. UNIX for Dummies Questions & Answers

background process

How, can I hide background process's output? (5 Replies)
Discussion started by: zylwyz
5 Replies

3. Shell Programming and Scripting

background process

can anybody plz tell me how can i find the background processes running. (2 Replies)
Discussion started by: Raom
2 Replies

4. Shell Programming and Scripting

background process

i gave a copy process in the background( to copy around 100GB) , while in progress, the session got terminated. when i relogged in and checked the destination folder the copying was in progress... how could it happen(copying) when the shell terminates??? :rolleyes: (2 Replies)
Discussion started by: vinod.thayil
2 Replies

5. Shell Programming and Scripting

How to process and run a program in the background in perl?

Hi, I have a query about processing and running Perl program at the background. I have HTML file called Userform.html which accepts input from the user. As soon as input is given the contol goes to get.cgi (get.cgi does some processing and computing tasks). Actually get .cgi takes more... (0 Replies)
Discussion started by: vanitham
0 Replies

6. UNIX for Dummies Questions & Answers

Background Process

I need to submit a script that will continue to run after logging out and after a reboot or shutdown. I entered the following: nohup script & The script continues to run in the background after logging off the system but is killed after a reboot or shutdown. Any help would be greatly... (1 Reply)
Discussion started by: powwm
1 Replies

7. UNIX for Dummies Questions & Answers

Script to start background process and then kill process

What I need to learn is how to use a script that launches background processes, and then kills those processes as needed. The script successfully launches the script. But how do I check to see if the job exists before I kill it? I know my problem is mostly failure to understand parameter... (4 Replies)
Discussion started by: holocene
4 Replies

8. Shell Programming and Scripting

How to put FTP process as a background process/job in perl?

Hi, I am using net::ftp for transferring files now i am trying in the same Linux server as a result ftp is very fast but if the server is other location (remote) then the file transferred will be time consuming. So i want try putting FTP part as a background process. I am unaware how to do... (5 Replies)
Discussion started by: vanitham
5 Replies

9. Shell Programming and Scripting

How to call a background process in perl?

Hi, I want to put the following code as a parallel or background process The program is as below: $n=10; #Count of files to be created. for($j=0;$j<=$n;$j++) { open(FH,">files_$j.txt") || warn "cannot create a file\n"; { print FH "count of file: $j\n"; #Sample data to be written. just... (5 Replies)
Discussion started by: vanitham
5 Replies

10. Shell Programming and Scripting

Make background process interact with fg process

Hi, I have written a menu driven shell script in which as per the choice, I run the another script on background. For eg: 1. get info 2)process info 3)modify info All the operations have different scripts which i schedule in background using &. However I wish to display the error... (0 Replies)
Discussion started by: ashima jain
0 Replies
SOAPSH(1)						User Contributed Perl Documentation						 SOAPSH(1)

NAME
SOAPsh.pl - Interactive shell for SOAP calls SYNOPSIS
perl SOAPsh.pl http://services.soaplite.com/examples.cgi http://www.soaplite.com/My/Examples > getStateName(2) > getStateNames(1,2,3,7) > getStateList([1,9]) > getStateStruct({a=>1, b=>24}) > Ctrl-D (Ctrl-Z on Windows) or # all parameters after uri will be executed as methods perl SOAPsh.pl http://soap.4s4c.com/ssss4c/soap.asp http://simon.fell.com/calc doubler([10,20,30]) > Ctrl-D (Ctrl-Z on Windows) DESCRIPTION
SOAPsh.pl is a shell for making SOAP calls. It takes two parameters: mandatory endpoint and optional uri (actually it will tell you about it if you try to run it). Additional commands can follow. After that you'll be able to run any methods of SOAP::Lite, like autotype, readable, encoding, etc. You can run it the same way as you do it in your Perl script. You'll see output from method, result of SOAP call, detailed info on SOAP faulure or transport error. For full list of available methods see documentation for SOAP::Lite. Along with methods of SOAP::Lite you'll be able (and that's much more interesting) run any SOAP methods you know about on remote server and see processed results. You can even switch on debugging (with call something like: "on_debug(sub{print@_})") and see SOAP code with headers sent and recieved. COPYRIGHT
Copyright (C) 2000 Paul Kulchenko. All rights reserved. AUTHOR
Paul Kulchenko (paulclinger@yahoo.com) perl v5.12.1 2010-07-05 SOAPSH(1)
All times are GMT -4. The time now is 08:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy