Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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.


Comment on Re: perl suppressing warnings when executing java class
Download Code
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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (19)
As of 2014-07-24 15:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (161 votes), past polls