http://qs321.pair.com?node_id=1214804


in reply to use getpwent to find users and delete them

If you use system LIST with the list having more than one element, then your command line arguments need to be separate elements, otherwise you're currently trying to run a program named literally "sudo /usr/sbin/userdel". Try my @cmd = ("sudo", "/usr/sbin/userdel", "-r", $account);.