Note that /bin/passwd is an especially tough example for this sort of thing -- to quote Abigail-II's reply to a another recent thread on a similar topic: ... passwd reads directly from the (pseudo)-terminal, not from STDIN.
update: my suggestion of copying from the module wasn't intended to be facetious -- well, not entirely -- but by starting down that path, you will get a good sense of the handicap that comes with seeking a no-modules solution for this sort of problem. I haven't looked at the Expect.pm source code -- it might very well use (depend on) other modules, and you'd need to copy relevant code from them as well.
Granted, there is the rare situation where module installation is beyond your personal control, and you need a work-around. But then again, for things that involve unix user-accounts and related security issues, we should not expect (or want) work-arounds to be an easy matter -- e.g. if it's hard or impossible to execute /bin/passwd via a CGI script (e.g. because the sysadmin won't provide Expect.pm in this context), that's not an unreasonable situation, and it would be quite foolish to circumvent that.
In reply to Re: IPC/Expect w/o modules
by graff
in thread IPC/Expect w/o modules
by Sapient2003
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |