I am absolutely positive that I have seen this in books as a typical user syntax issue, but I just sold my Cozens book so, I have to turn to the monastery.

My code, is pretty basic

#!/usr/bin/perl -w ## module calls use strict; use Net::SNMP; ## start snmp session my $s = Net::SNMP->session( -hostname => "10.6.21.10", -community => "private" ); ## run the get my $ios_version = $s->get_request(".1.3.6.1.2.1.1.1.0"); my $error = $s->error; ## close the snmp session $s->close; ## print results print "$error\n$ios_version\n\n";

however the output of $ios_version ends up being

HASH(0x811fb50)

i am sure that i have seen this error before, and i had thought it had something to do with trying to represent a hash value as a scalar or vice versa. however, making $ios_version into @ios_version still provides the same output. can someone beat this into my head one more time so it stays?

humbly -c


In reply to Hash value being called as a Scalar? by c

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.