Beefy Boxes and Bandwidth Generously Provided by pair Networks kudra
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

2 programs as 2 processes

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

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.

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'.
Re: 2 programs as 2 processes
by jreades (Friar) on Sep 22, 2000 at 18:30 UTC
Re (tilly) 1: 2 programs as 2 processes
by tilly (Archbishop) on Sep 22, 2000 at 18:32 UTC
(bbq) Re: 2 programs as 2 processes
by BBQ (Curate) on Sep 22, 2000 at 18: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")

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
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.