[root@stationx perl]# cat w.pl #!/usr/bin/perl $filename='/etc/passwd'; open(FILE,$filename)or die; while($line = <FILE>){ ($username,$secret,$uid,$gid)=split(":",$line); print "$username,$gid\n"; } close(FILE); $filen='/etc/group'; open(GROUP,$filen)or die; while(<GROUP>){ ($groupname)=split(":"); print "$groupname\n"; } close(GROUP);