in reply to Re: Output of a command
in thread Output of a command

YES you are right. Thanks on this!!!!! The output is going to STDERR.
Now my question is, should it go to STDERR when its not an error? this is just get the information of the product!!!!

Replies are listed 'Best First'.
Re^3: Output of a command
by ysth (Canon) on Jul 30, 2008 at 05:52 UTC
      It's a pet peeve of mine for help text explicitly requested to go to stderr. If I asked for it, and it's long, please put it on stdout so I don't have to work harder to pipe it into $PAGER. Of course, if something's wrong and you need to give me an error message with some helpful text, it's fine to put it on stderr to lessen the chance of breaking my pipes.
        Yeah. Help going to stderr also breaks the --help|less idiom.
Re^3: Output of a command
by Alien (Monk) on Jul 30, 2008 at 06:20 UTC
    You could be using IPC::Open3 , it will get output from STDOUT,STDERR .
Re^3: Output of a command
by Perlbotics (Archbishop) on Jul 30, 2008 at 10:06 UTC
    Some examples (*nix) if you only need one stream of the commands output:
    $command = "curl -D- http://www.perlmonks.org"; # mixes stderr and st +dout # stdout only, no stderr noise $stdout_only = `$command 2>/dev/null`; # stderr only, no stdout noise $stderr_only = `$command 2>&1 1>/dev/null`; # both mixed up (usually not a good idea!) # Aliens suggestion to use open3 is better in this case. $brundlefly = `$command 2>&1`;