klimenkoandrey has asked for the wisdom of the Perl Monks concerning the following question:
when i use just open
output finemy $sql = "select * from users"; open (COMMAND, "| /opt/sql " ) || die $!; print (COMMAND "connect credentials") print (COMMAND "$sql\n");
--> 4, 4, Reporting, , F, 1, 0, 0, 0, 0, 0, F, 0, F, 0, F, , BLOB(0)
But when i use just open i can't grab output of $sql command (just in terminal). When i use open2 (and 3 too)
I've got almost same output but have ">"my $sql = "select * from users"; my $pid = open2 (OUT, IN, "/opt/sql") || die $!; print (IN "connect credentials"); print (IN "$sql\n"); while (<OUT>) { print $_; }
--> 4, >4, Reporting, , F, 1, 0, 0, 0, 0, 0, F, 0, F, 0, F, , BLOB(0)
I guess this trouble in terminal environment (but maybe and not). Can anyone tell me can i grab clear output in this is situation?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: open2 or 3 run command using pty
by Corion (Patriarch) on Jul 21, 2014 at 09:27 UTC | |
by klimenkoandrey (Initiate) on Jul 21, 2014 at 09:34 UTC | |
by Corion (Patriarch) on Jul 21, 2014 at 09:38 UTC | |
by klimenkoandrey (Initiate) on Jul 21, 2014 at 09:40 UTC | |
by klimenkoandrey (Initiate) on Jul 21, 2014 at 10:03 UTC | |
by Corion (Patriarch) on Jul 21, 2014 at 10:08 UTC | |
|
Re: open2 or 3 run command using pty
by soonix (Chancellor) on Jul 21, 2014 at 10:51 UTC | |
by klimenkoandrey (Initiate) on Jul 21, 2014 at 11:33 UTC |