programming-examples/perl/SystemFunction/Read password.pl
2019-11-15 12:59:38 +01:00

15 lines
274 B
Perl

#!/usr/bin/perl
use warnings;
use strict;
use Text::ParseWords;
my (@users, @fields);
if (open PASSWD,"/etc/passwd") {
@users = <PASSWD>;
chomp @users; # remove linefeeds
@fields = quotewords(':', 0, @users);
close PASSWD;
}
print "@fields";