$filesystem = $ARGV[0]; #store the file system you would like to run DU command on if ( $ARGV[0] eq "" ) { die "usage: $0 filename\n"; } $host=`hostname`; my %filesystems = ( hosta => { desc => 'x', filesystemA => [ qq|/the/first/filesystem|], filesystemB => [ qq|/the/second/fielsystem| ] }, hostb => { desc => 'r', filesystemA => [ qq|/the/first/filesystem | ], filesystemB => [qq|no filesystemB for 2nd host |]} ); $choice = $filesystems{$host}; if ( not $filesystems{filesystemA}{$filesystem} ) { print "error\n"; }