Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 05:08 UTC ( #62641=perlquestion: print w/replies, xml ) Need Help??

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 05: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 10: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
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2023-03-24 12:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (61 votes). Check out past polls.

    Notices?