in reply to substr Rampage
To read the password file try something like this code..
open my $passwdfh, "<", "/etc/passwd" or die "couldn't open the passwo +rd file: $!\n"; while (<$passwdfh>) { next if /^\s*#/; # comments in the password file? chomp; my ($login, $passwd, $uid, $gid, $gcos, $home, $shell) = split /:/; # do stuff with the entries from the password file now ... next if $uid < 1000; # .. for example. } close $passwdfh;
|
|---|