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

Re: [PBML] Re: Using Command line in a Perl script

Expand Messages
  • merlyn@stonehenge.com
    ... brianlamere --- In perl-beginner@yahoogroups.com, micro_learner ... brianlamere np. Wanted to clarify something though - you /can/ catch the output
    Message 1 of 5 , Mar 25 6:48 PM
      >>>>> "brianlamere" == brianlamere <brian.lamere@...> writes:

      brianlamere> --- In perl-beginner@yahoogroups.com, "micro_learner"
      brianlamere> <micro_learner@y...> wrote:
      >> Thanks very much..u were really helpfull
      >> > @output = qx/merlin -d $file1 -m $file2 -p $file3/;
      >> >
      >> > The output is an array...don't try to catch it as a scalar :)

      brianlamere> np. Wanted to clarify something though - you /can/ catch the output
      brianlamere> of qx as a scalar...but if memory serves you end up getting the exit
      brianlamere> status, just like if you had run "system."

      Better get that memory fixed. :)

      $output = qx/.../;

      gets the entire output as one string. To get the exit status
      for qx//, waited process, or the most recent closed pipe-handle,
      use $? instead.

      print "Just another Perl hacker,"

      Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
      <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
      Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
      See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
    Your message has been successfully submitted and would be delivered to recipients shortly.