in reply to Re^3: Mulitple values for a key in a hash (Pennance Required)
in thread Mulitple values for a key in a hash

At the momment I am using the following: But it is still reporting an error, even though, I am running it on the correct host and the file system is on the host. Is the check correct? Am I defreferencing it properly?
$host=`hostname`; $filesystem = ARGV[0]; my %filesystems = ( hosta => (desc => 'x', filesystems => (qq|/dat +a/file/a| =>0, qq|/data/file/b| =>0)), tx05 => (desc => 'r',filesystems => (qq|/data/ +file/c| =>0, qq|no filesystemB for 2nd host | => 0))); if ( ! exists $filesystems{$host}{filesystems}{$filesystem} ) { print "error\n";} else {print "Found filesystem $filesystem on host $host\n". $filesyste +ms{$host}{descr}."\n";}

Replies are listed 'Best First'.
Re^5: Mulitple values for a key in a hash
by roboticus (Chancellor) on Nov 30, 2007 at 20:48 UTC
    wishartz:

    I've fixed my goofs in my earlier node (I used parenthesis instead of curly braces in the data structure!). You should have better luck this time ... it's no longer untested. ;^)

    ...roboticus