Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

2 programs as 2 processes

by Anonymous Monk
on Sep 22, 2000 at 22:15 UTC ( [id://33671]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi. Is it possibly in Perl to EXECUTE 2 PROGRAMS from ONE in that way, that the 2 programs were working at the same time - 2 PROCESSES ??? I made Perl program: system("c:\\valeriy\\program2\\pr1.pl"); system("c:\\valeriy\\program2\\pr2.pl"); But It executes FIRST, then WAITS, than executes 2ND. I need then working at the same time, paralelly. :) Hope here are Perl professionals.

Replies are listed 'Best First'.
(bbq) Re: 2 programs as 2 processes
by BBQ (Curate) on Sep 22, 2000 at 22:36 UTC
    use the fork, Luke...

    #!/home/bbq/bin/perl
    # Trust no1!

      Note that the originaly poster appears to be using a Microsoft "operating system" which means that fork probably isn't the best choice. This is because prior to Perl 5.6.0, fork() didn't work. With Perl 5.6.0, fork() might work for this but it is very new and appears to be quite buggy in some situations.

      Personally I'd use system(1,"script") to prevent the calling script from waiting.

              - tye (but my friends call me "Tye")
Re (tilly) 1: 2 programs as 2 processes
by tilly (Archbishop) on Sep 22, 2000 at 22:32 UTC
Re: 2 programs as 2 processes
by jreades (Friar) on Sep 22, 2000 at 22:30 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://33671]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-19 03:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found