That's not going to work, if you're trying to capture the text. If you want to make an assignment, use qx (same as the `...` operator). When you use system, the return value has a different meaning (it's the program's exit status).
Why don't you try what jettero suggested? ...
use strict; use warnings; + my $user = 'root'; my $chk_user = `ypmatch $user password 2>&1`; print "Results of 'ypmatch' for user '$user' => '$chk_user'\n";
In reply to Re^4: unix command in perl
by liverpole
in thread unix command in perl
by sagibeli
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |