henrycui has asked for the wisdom of the Perl Monks concerning the following question:
This invokes the perl from Java. In my perl script, I get the argument in this way:Process p = Runtime.getRuntime().exec("c:/perl.exe" C:/CreateER.pl "Please \n ignore \n my friend");
The line break was removed when retrieving the argument. The argument becomes:@ARGV[1] =~ s/\\n/\n/g; print(@ARGV[1]);
I want to keep the line breaks. This is not what I want. However, if I run the perl command directly:Please ignore my friend
It works fine. The correct argument is retrieved:c:/perl.exe C:/scripts2/CreateER.pl "Please \n ignore \n my friend");
So it appears the problem happens in the Perl/Java integration. Any ideas? Thanks very much!Please ignore my friend
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with the Perl/Java intergarion when new line break is used in the argument
by pobocks (Chaplain) on Dec 12, 2008 at 17:31 UTC | |
by henrycui (Initiate) on Dec 12, 2008 at 18:53 UTC | |
by pobocks (Chaplain) on Dec 12, 2008 at 19:56 UTC | |
|
Re: Problem with the Perl/Java intergarion when new line break is used in the argument
by toolic (Bishop) on Dec 12, 2008 at 17:13 UTC | |
|
Re: Problem with the Perl/Java intergarion when new line break is used in the argument
by matze77 (Friar) on Dec 12, 2008 at 16:48 UTC | |
|
Re: Problem with the Perl/Java intergarion when new line break is used in the argument
by Anonymous Monk on Dec 12, 2008 at 17:55 UTC |