in reply to perl suppressing warnings when executing java class

Why are you doing print `$command`?! That's pretty silly; why capture the output instead of letting it print, and then do nothing but print it?

To hide the warnings, why not simply redirect STDERR to null? Or alternatively, redirect STDOUT to a file and save the data directly.

PS: "0 down vote favorite"? Good way to collect some downvotes for trying to tell people how to vote.

Replies are listed 'Best First'.
Re^2: perl suppressing warnings when executing java class
by sandeepda (Novice) on May 13, 2013 at 21:19 UTC
    I am surprised how my java is getting called without system command

      print `foo` means pretty much the same thing as system("foo"); it's just less efficient (because it reads all of foo's output into a scalar before printing it out).

      package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
      The back-tick (`) operator invokes the Shell and passes the content to it to be executed. See "Quote and Quote-like operators" in the online documentation ($ perldoc -f `).

      ----
      I Go Back to Sleep, Now.

      OGB