On Tue, Jul 19, 2011 at 12:14 PM, Tessio Fechine <oiss...@gmail.com> wrote:
> Hello,
> I have a subroutine that uses useradd to create accounts
>
> --
> @cmd = ('useradd', '-m', $account);
> my $result = system @cmd;
> --
>
> but when useradd fails, I need to stop it from sending the error message to
> STDER.
> Is it possible with system?
>
> Thanks!

Just as you would when using the shell, redirect STDERR somewhere
else: "2>/dev/null".

Kevin.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to