Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: perl suppressing warnings when executing java class

by Anonymous Monk
on May 13, 2013 at 21:01 UTC ( #1033357=note: print w/replies, xml ) Need Help??

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.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1033357]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2018-05-27 12:33 GMT
Find Nodes?
    Voting Booth?