Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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\\"); system("c:\\valeriy\\program2\\"); 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...

    # 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?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://33671]
Approved by root
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-06-18 12:36 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.