LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-26-2010, 10:26 AM   #1
listener
LQ Newbie
 
Registered: Dec 2009
Posts: 10

Rep: Reputation: 0
Perl equivalent of shell for &


I wrote a spinner in Perl and when I did a spinner in shell I could just run the subroutine in the background.

my_spinner &;
PID=$!;
#do something here
my_spinner_stop $PID;

In Perl, how do you run a function in a background and get the PID for that? I know PID in Perl is $$



thanks,
listener

Last edited by listener; 03-26-2010 at 10:37 AM.
 
Old 03-26-2010, 10:28 AM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by listener View Post
I wrote a spinner in Perl and when I did a spinner in shell I could just run the subroutine in the background.

my_spinner &;
PID=$!;
#do something here
my_spinner_stop $PID;

In Perl, how do you run a function in a background and get the PID for that? I know PID in Perl is $$



thanks,
listener
http://search.cpan.org/~rybskej/forks-0.33/lib/forks.pm
 
Old 03-26-2010, 10:37 AM   #3
listener
LQ Newbie
 
Registered: Dec 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks

Last edited by listener; 03-26-2010 at 10:39 AM. Reason: Posted before page refreshed with reply
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can we open a browser (firefox/IE) & enter URL in it via shell/PERL script. barde Linux - Newbie 6 02-18-2009 05:21 AM
bash equivalent of <perl -e 'print time'> teabag_46 Linux - Newbie 2 10-23-2007 03:04 PM
Korn Shell equivalent bassplayer69 Linux - General 1 08-02-2007 01:15 PM
The perl equivalent... Ateo Programming 4 04-09-2005 02:23 AM
shell script + change shell && continue darkRoom Programming 6 02-25-2005 02:50 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration