#!/usr/bin/perl
open (FILE, "userlist");
@lines = <FILE>;
close (FILE);
foreach (@lines)
    {
    (my $UserName, my $PassWord, my $Uid, my $Group, my $Comment) = split (/:/,$_);
    system("/usr/sbin/pw useradd -n $UserName -u $Uid -c $Comment -d /home/$UserName -g $Group -m -k /etc/skel -s /usr/local/bin/bash");system("/usr/local/bin/autopasswd", $UserName, $PassWord);
}
