Re: [PBML] Re: Using Command line in a Perl script
>>>>> "brianlamere" == brianlamere <brian.lamere@...> writes:brianlamere> --- In firstname.lastname@example.org, "micro_learner"
brianlamere> <micro_learner@y...> wrote:
>> Thanks very much..u were really helpfullbrianlamere> np. Wanted to clarify something though - you /can/ catch the output
>> > @output = qx/merlin -d $file1 -m $file2 -p $file3/;
>> > The output is an array...don't try to catch it as a scalar :)
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
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!