A shorter way to do this in sh is to make use of the fact that
a simple command can be invoked while passing it an environment
variable. So in sh one will say:
EDITOR="cp /tmp/newpasswd" /etc/vipw
and in the corresponding perl script
system('EDITOR="cp /tmp/newpasswd" /etc/vipw');