system command in perl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Selva123
    New Member
    • May 2010
    • 10

    system command in perl

    Hi All,
    Greetings. May be simple issue but your help sought.
    I am executing the system command like
    $res=system("no tepad.exe"); thro a perl file named aa.pl.

    At command prompt - when I enter
    perl aa.pl , I could see that notepad was opened but the control - I say as prompt ( in windows) does not return back.
    It looks like perl response is hanging.
    I have to stop the precess with ctrl+c

    Any idea ??
    Envn - Windows XP
    This is perl, v5.8.9 built for MSWin32-x86-multi-thread
  • kleach
    New Member
    • Jun 2010
    • 15

    #2
    My perl version seems to do what I expect.
    This is perl, v5.10.1 built for MSWin32-x86-multi-thread

    It runs the system command and waits syncronously for the return of the application. Once notepad ends, the perl script ends and the DOS window returns to the prompt.

    Comment

    • nithinpes
      Recognized Expert Contributor
      • Dec 2007
      • 410

      #3
      If you want to return the control without closing the notepad, use:
      Code:
      $res=exec("notepad.exe");

      Comment

      Working...