Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: spawning Perl scripts (Win32/Linux sample)

by gmpassos (Priest)
on Mar 29, 2003 at 01:55 UTC ( [id://246572]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
        sleep(1);
      }
    
  2. or download this
    my $cmd = "$^X foo.pl arg1" ; ## $^X is the path to perl(.exe) interpr
    +eter.
    open (CMDLOG,"| $cmd") ; close (CMDLOG) ;
    
  3. or download this
    open (CMDLOG,"| $cmd") ;
    ## Now you can continue your main (caller) script...
    
  4. or download this
    use IPC::Open3 ;
    my $cmd = "$^X foo.pl arg1" ;
    ...
    my @log = (<LOGREAD> , <LOGERROR>) ;
    close(LOGREAD , LOGERROR, LOGWRITE) ;
    print "@log\n" ;
    
  5. or download this
    open (CMDLOG1,"| $cmd1") ;
    open (CMDLOG2,"| $cmd2") ;
    open (CMDLOG3,"| $cmd3") ;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-19 08:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found