sschneid has asked for the wisdom of the Perl Monks concerning the following question:
I'd like my data structure to be in the form of $password->{'root'}->{'dsc'} = 'Super-user'. The problem is, my Dumper output has SCALAR listed instead of the attribute ('dsc'). Any help would be greatly appreciated. Thanks.#!/usr/local/bin/perl -w use strict; my $password; open F, '/etc/passwd'; while (<F>) { my ($nam, $pwd, $uid, $gid, $dsc, $hom, $shl) = split /:/, $_; my @attrs = \($nam, $pwd, $uid, $gid, $dsc, $hom, $shl); foreach my $attr (@attrs) { $password->{"$nam"}->{"$attr"} = $$attr; } } close F; use Data::Dumper; print Dumper $password;
|
|---|