#!/usr/bin/perl use Unix::PasswdFile; ($sec,$min,$hour,$dy)=localtime(time); $stamp=".".$hour.$min.$sec; $pw = new Unix::PasswdFile, "/etc/passwd"; $pw->user("joeblow", $pw->maxuid + 1, 10,"Joe Blow", "/export/home/joeblow", "/bin/ksh"); $pw->delete("deadguy"); $pw->passwd("johndoe", $pw->encpass("newpass")); foreach $user ($pw->users) { print "Username: $user, Full Name: ", $pw->gecos($user), "\n"; } $pw->commit(backup => 'bak'); $pw->commit(backup=>$stamp); undef $pw;