Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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.

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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1033357]
help
Chatterbox?
[LanX]: M-x untabify
[choroba]: I don't think they're multiple people. I was told "he or she" sounds old-fashioned and "they" is the way to say it
[pryrt]: Those others were definitely offensive or unequivocably rude, I agree.
[choroba]: (well, it comes from the 14th century, so labelling it as "modern" doesn't seem appropriate)
[Your Mother]: "They" is becoming accepted but it irritates me sometimes. I tend to just pick she or he randomly or try to use "one."
LanX thinks it is appropriate here :)
[Your Mother]: They would think so.
[jdporter]: ok, I need a recipe for piping lines "through" an external program which is itself a filter
[jdporter]: without using a tmp file
[1nickt]: tobyink perl -MTypes::Standard= is_Int -Mstrict -wE 'say 1 if is_Int 1.0'

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (17)
As of 2017-05-24 20:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?