in reply to Hash value being called as a Scalar?

  print "$error\n$ios_version\n\n"; however the output of $ios_version ends up being HASH(0x811fb50)

The output shows that $ios_version is a reference to hash. Using double quotes is not the proper way to (s)print a composite data structure. One generic way is provided by Data::Dumper.

use Data::dumper; ... print Dumper $ios_version;

-- stefp