in reply to Running perl from java

You need to read up carefully on the java equivalents of system/exec

What is happening, is you think you're invoking the shell, when you're probably not (or its a different shell, with different quoting rules)

$ perl -V:sh sh='cmd /x /c'; $ perl -e die(1) 1 at -e line 1. $ perl -e " die(1) " 1 at -e line 1. $ perl -e ' die(1) ' Can't find string terminator "'" anywhere before EOF at -e line 1. $ perl -MO=Deparse,-p -e 'die(1)' '???'; -e syntax OK $ perl -MO=Deparse,-p -e "die(1)" die(1); -e syntax OK $ perl -MO=Deparse,-p -e " system qw! perl -e warn(@ARGV) a r g v !" system('perl', '-e', 'warn(@ARGV)', 'a', 'r', 'g', 'v'); -e syntax OK $ perl -e " system qw! perl -e warn(@ARGV) a r g v !" argv at -e line 1.
Also, you should have gotten error messages when you were error checking :)

Replies are listed 'Best First'.
Re^2: Running perl from java
by abramia (Novice) on Jan 06, 2011 at 12:59 UTC
    Anonymous Monk,

    Thank you for your reply, which was helpful to me.

    Nonetheless I would be grateful for a clarification. (And please pardon my ignorance.)

    How do I perform this "error checking" you mention?

    Thank you, Avi.
      How do I perform this "error checking" you mention?

      In java they call them exceptions -- you shouldn't ignore them

        Anon,

        I can assure you that I have not ignored any exceptions.

        Cheers, Avi.