in reply to Mulitple values for a key in a hash

Hash keys are strings. You can get away with {key=>2} if and only if the key doesn't have strange symbols in it. I bet you need filesystem => { "/file/system/a" => 1, "/file/system/b" => 2 } or something like that.

You also have to keep things balanced... { key1 => key2 => 3 } probalby doesn't mean what you think. It's actually { key1 => 'key2', 3=>undef }.

Also, what doesn't work?

-Paul

Replies are listed 'Best First'.
Re^2: Mulitple values for a key in a hash
by wishartz (Beadle) on Nov 29, 2007 at 14:58 UTC
    Thank's for the help. What I meant by it doesn't work, is there was something worng with the syntax and it was generating an error when I ran it. I would like to run the script with an argument being the file system. That part I can do, by saving the contents of ARGV[0] into the variable $filesystem. I would then like to check that the file system is served by the host that the program is running on. If it isn't report an error. for example: $host = `hostname`; $filesystem = $ARGV[0]; Now I would like to check those details against my hash. That is the part that is confusing me. One host could have multiple filesystems. How would I go about looking up whether the file system belongs to the host, or not? Thanks