I'm sorry if this is a duplicate post, but I think I put my reply in the wrong place.
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? The first if condition should have been false, but instead it is coming out as true and printing out error.
$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";}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
|
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.