Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Keep It Simple, Stupid
 
PerlMonks  

How to continue a script after using a system call without the system call has been closed

by juo (Curate)
on Mar 07, 2001 at 00:08 UTC ( [id://62641]=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.

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

Dear all, I would like to do the following : system(notepad test.txt); print "This is a test\n"; Now to get the line "This is a test" I need to close my notepad first. Is their a way that the script opens the notepad but keep running the script without that I have to close notepad first. Thanks, Pieter
  • Comment on How to continue a script after using a system call without the system call has been closed

Replies are listed 'Best First'.
Re: How to continue a script after using a system call without the system call has been closed
by $code or die (Deacon) on Mar 07, 2001 at 00:19 UTC
    use Win32::Process - It's standard with ActiveState Perl. e.g....

    use Win32::Process; my $Notepad; Win32::Process::Create($Notepad,"D:\\winnt\\system32\\notepad.exe","no +tepad test.txt",0,CREATE_NEW_CONSOLE,".")|| die ErrorReport();

    $code or die
    $ perldoc perldoc
Re: How to continue a script after using a system call without the system call has been closed
by vladdrak (Monk) on Mar 07, 2001 at 05:21 UTC
    you can also do either:
    system("start notepad test.txt");
    or
    `notepad test.txt`;

      I've found that using Win32::Process is better as calling start requires a DOS window to be open

      $japh->{'Caillte'} = $me;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://62641]
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.