in reply to Re: Strange Behaviour with Backticks
in thread Strange Behaviour with Backticks
... the program is checking if it's stdout is a TTY or not and behaving differently based upon that.But, the strange thing in my setting is that one parameter ('A') works well, but not the other ('B')?
You could check by using your shell to redirect the output into a file and see if it behaves similarly.Actually it runs under CGI script. And following your suggestion, I did pass the output into a file using standard open file handle.
But the out.txt shows nothing, i.e it gives: $VAR1=[];#!/usr/bin/perl -w use strict; use CGI qw/:standard/; use Data::Dumper; use Carp; print header(); my $param = 'A'; # or otherwise not working 'B' my $OUTFILE_file_name = 'out.txt'; @output = `some_binary.out $param`; chomp output; open ( OUTFILE, '>', $OUTFILE_file_name ) or croak "$0 : failed to open $OUTFILE_file_name : $!\n"; print OUTFILE Dumper \@output; close ( OUTFILE );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Strange Behaviour with Backticks
by Fletch (Bishop) on Jul 21, 2006 at 15:27 UTC | |
|
Re^3: Strange Behaviour with Backticks
by BrowserUk (Patriarch) on Jul 21, 2006 at 17:16 UTC |