in reply to print a hash ref

$cacheDBs{$db}{mxs} is a hash reference. If you want to print its keys and values, do so:
for my $key (keys %cacheDBs) { my $mxs = join ':', map "$_ $cacheDBs{$db}{mxs}{$_}", keys %{ $cac +heDBs{$db}{mxs} }; print "\n/opt/freeware/bin/gmetric -n $db -T $db -g $Ggroup -t dou +ble -u MaxSize -v $mxs -d 45)\n"; }

Untested (the code was not runnable to demonstrate the issue).

لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: print a hash ref
by teamassociated (Sexton) on Jul 09, 2013 at 14:07 UTC
    ok thank you! it ran to completion, however I dont want the GB or MB printed which is why I put it as a value: any way I can only print the 1.0 in mxs and not the GB? I still need the letters GB/MB but cannot have them in the gmetric CLI. maybe use an array to store GB/MB?
    '/cache-m/usr/cachesys/mgr/' => { 'free' => '91.7', 'sz' => '1.0', 'mxs' => { '1.0' => 'GB' }, 'dfree' => '2.2', 'avail' => '917'
      Not a nice way, but if it's only for printing, treat it like a number, e.g. add 0 to it and print the result.


      I'm too lazy to be proud of being impatient.
        well its a lot of prints, 114 to be exact.