• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 205
  • Last Modified:

Command line output: display concerns

I have a cgi Perl file that runs an exe file in command prompt. Although I never used a print command in perl, the web page displays the results. I need a way to stop displaying the results. I tried @some_array = `$command`;
Didn't work.
0
n4narik
Asked:
n4narik
1 Solution
 
wlfsCommented:
On windows (I assume windows due to the exe file) try:
  `$command > nul 2> nul`;
on unix try
  `$command > /dev/null 2> /dev/null`;

This way all output and error output of $command is redirected into nirvana. (You will also not be able to retrieve a result from that command in perl).
0
 
TintinCommented:
Do you need to capture the output?

Try

my $output = `$command 2>&1`;
0
 
kblack05Commented:
Put this JUST under the shebang line, like so...

#!/usr/bin/perl
BEGIN {
open (STDERR, ">/path/to/somewhere/error.txt");
}

Regards,

~K Black~
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now