in reply to SCALAR output instead of attribute name.
It looks like you're expecting a reference to, say, $nam to stringify to nam. It doesn't, because the names are there for your convenience, not Perl's. I'd write something like this:
my $password = {}; while (<F>) { my ($name, @attributes) = split(/:/, $_); my %attributes; @attributes{qw( pwd uid gid dsc hom shl )} = @attributes; $password->{$name} = \%attributes; }
|
|---|