perl hide system output

Posted by Chris on Server Fault See other posts from Server Fault or by Chris
Published on 2010-04-01T19:19:34Z Indexed on 2010/04/01 19:23 UTC
Read the original article Hit count: 520

Filed under:
|
|

Using perl 5.8.8 on linux, need the output of a perl 'system' command to be hidden. The command in my code is :

system("wget", "$url", "-Omy_folder/$date-$target.html", "--user-agent=$useragent");

I've tried using "> /dev/null 2>&1" in different places in the system command, like this-

system("wget", "$url", "-Omy_folder/$date-$target.html", "--user-agent=$useragent","> /dev/null 2>&1");

Can anyone help me with where the redirection to /dev/null should be?

© Server Fault or respective owner

Related posts about perl

Related posts about system