Loading ...
Sorry, an error occurred while loading the content.

Running external commands on a Windows system

Expand Messages
  • george.szynal
    Page 17 of the Llamma book gives an example of how to call an external command. When I tried a rendition of it on WinXP with perl5.8.8.exe, it errs as follows.
    Message 1 of 1 , Aug 6 10:19 PM
    • 0 Attachment
      Page 17 of the Llamma book gives an example of how to call an
      external command. When I tried a rendition of it on WinXP with
      perl5.8.8.exe, it errs as follows.
      Teste.pl
      #!c:\perl\bin
      use strict;
      while (chomp (my @lines = `dir/s/b`)) {
      print;
      }

      What happens is that the program prints nothing until exit w/ CTRL-C.
      What it prints is whatever I type at <STDIN> from the keyboard
      while the program is running. The following was captured from the
      command window after running the script.

      C:\perlscripts>perl teste.pl -w
      Terminating on signal SIGINT(2)

      C:\perlscripts>perl teste.pl -w
      Terminating on signal SIGINT(2)

      C:\perlscripts>I typed this while the program appeard to pause
      'I' is not recognized as an internal or external command,
      operable program or batch file.

      C:\perlscripts>then I hit Enter and typed this
      'then' is not recognized as an internal or external command,
      operable program or batch file.

      C:\perlscripts>Then I typed som emore
      'Then' is not recognized as an internal or external command,
      operable program or batch file.

      C:\perlscripts>and then I hit CTRL-C
      'and' is not recognized as an internal or external command,
      operable program or batch file.
    Your message has been successfully submitted and would be delivered to recipients shortly.