Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^4: Mulitple values for a key in a hash

by wishartz (Beadle)
on Nov 30, 2007 at 11:29 UTC ( [id://654085]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://654085]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-19 05:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found