in reply to EOF problem with sqlplus on Windows
qx quotes its argument (similar to a double-quoted string, only that the string is executed afterwards. Hence the here document is not interpreted by Perl.
Maybe you intended to have the HERE document being interpreted by the shell, but this doesn't work either, because passing a multi-line string to qx does not cause the shell to execute a multi-line script. Here a simple example from the command line (I'm using Windows for this, but the same applies to Linux etc):
As you can see, the shell is not executing two echo commands, but only one. If you want to execute multi-line shell commands, I suggest you create a temporary file (File::Temp), write the shell script into it, and execute it.C:\>perl -lwe "my $x=qx(echo a\necho b); print $x" a echo b
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: EOF problem with sqlplus on Windows
by choroba (Cardinal) on Mar 22, 2012 at 11:28 UTC | |
|
Re^2: EOF problem with sqlplus on Windows
by JavaFan (Canon) on Mar 22, 2012 at 11:31 UTC | |
by rovf (Priest) on Mar 22, 2012 at 14:27 UTC | |
by theophanie77 (Novice) on Mar 23, 2012 at 15:22 UTC | |
by JavaFan (Canon) on Mar 23, 2012 at 15:44 UTC | |
by choroba (Cardinal) on Mar 23, 2012 at 15:26 UTC | |
by theophanie77 (Novice) on Mar 23, 2012 at 15:48 UTC |