Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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 ( [id://729988]=note: print w/replies, xml ) Need Help??


in reply to Problem with the Perl/Java intergarion when new line break is used in the argument

Just for curiosity's sake, try:
Process p = Runtime.getRuntime().exec( "c:/perl.exe" C:/CreateER.pl "Please \\n ignore \\n my friend");

Memory and cursory googling point toward backslash being an escape character in Java, as well as Perl... Thus, your perl program is getting those as literal line breaks.

Essentially, it's being called as:

c:/perl.exe C:/CreateER.pl "Please ignore my friend"

Update: I tested my theory in Eclipse. A: I was correct. B: You totally owe me a coke for making me have to deal with eclipse ;-)

for(split(" ","tsuJ rehtonA lreP rekcaH")){print reverse . " "}print "\b.\n";
  • Comment on Re: Problem with the Perl/Java intergarion when new line break is used in the argument
  • Select or Download Code

Replies are listed 'Best First'.
Re^2: Problem with the Perl/Java intergarion when new line break is used in the argument
by henrycui (Initiate) on Dec 12, 2008 at 18:53 UTC
    I do owe you a coke. You solved my problem. Thanks very much!

      Glad to help ;-)

      Escaping mechanisms have been the bane of my existence often enough; especially Javascript/(PHP|Perl)/HTML conjoint escape issues. ::shudder::

      for(split(" ","tsuJ rehtonA lreP rekcaH")){print reverse . " "}print "\b.\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://729988]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2024-04-16 08:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found