in reply to qx and stderr

are you using strict?
is the definition of command declared in single or double quotes?

$output = `ls -? 2>&1` works fine for me

Update: Hmm.. I thought that defining in double quotes using &1 would possible cause problems - hence the strict question - no matter. But:

my $cmd = "ls -? 2>&1"; $output = qx/$cmd/; print "-" x 50, "\n", $output, "\n", "-" x 50, "\n"


works fine for me
--------------
It's sad that a family can be torn apart by such a such a simple thing as a pack of wild dogs

Replies are listed 'Best First'.
Re^2: qx and stderr
by Anonymous Monk on Feb 23, 2005 at 18:53 UTC
    no, i'm not using strict. but your inquiry about quoting may be my problem. this is how i'm putting a value into $cmd: qq/remsh $ctm_server -l ctmsrv "ctmshout -dest ECS -message '$msg'"/ i've got quotes on top of quotes on top of quotes (sigh). perhaps 2>&1 should be inbetween the last single and double (literal) quotes? - d
      Ohh... well, not sure what *NIX you're using, but the -a flag for remsh might help (as will the -n flag). Have you tried those?
      --------------
      It's sad that a family can be torn apart by such a such a simple thing as a pack of wild dogs