Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Selecting Passwordby LanX (Saint) |
on Jan 31, 2020 at 00:38 UTC ( [id://11112149]=note: print w/replies, xml ) | Need Help?? |
>
system qq {echo -e "$newpassword\n$newpassword" | passwd $username}; I'd say, don't use echo via the shell, use open to pipe directly.
For three or more arguments if MODE is |- , the filename is interpreted as a command to which output is to be piped, and if MODE is -| , the filename is interpreted as a command that pipes output to us. In the two-argument (and one-argument) form, one should replace dash (- ) with the command. See Using open() for IPC in perlipc for more examples of this. (You are not allowed to open to a command that pipes both in and out, but see IPC::Open2 , IPC::Open3 , and Bidirectional Communication with Another Process in perlipc for alternatives.)
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|