Hi
Some more detail,
my $f = '/etc/password';
open(F,$f) || die "Can't open passwd file\n$!\n";
while(<F>){
($uname,$password,$uid,$gid,$username,$home,$shell) = split(/:/,$_);
/* Now you have all fields. But $username you will have full username, may be address and some more comments right, So you do another split */
($firstname,$temp)= split(/\s+/,$username);
//\s+ will splits field by using one or more space
} #end of while
Sachin