in reply to Disable the printing of printable and control characters with Net::SNMP (was: SNMP)

I'm not quite sure what you're asking for. If you just want to print out all the values of $a as their hex values, then
my @bin = unpack 'C*', $a; $a = ''; for (@bin) { $a .= sprintf ' 0x%02x', $_; }
should do it. The coding style is pretty hard to get through (and you can get some pointers from the monks here if you'd like), but one thing that stands out is that you open "OUT" twice, without closing it.

Update: Woops, fixed unpack spec.

  • Comment on Re: Disable the printing of printable and control characters with Net::SNMP (was: SNMP)
  • Download Code

Replies are listed 'Best First'.
Re^2: Disable the printing of printable and control characters with Net::SNMP (was: SNMP)
by michaelW (Initiate) on Aug 03, 2006 at 16:06 UTC
    Trouble is that control characters are returned. Thanks anyway, I've contacted the Net::SNMP module author who suggests disabling the internal translation and performing my own. This was his response Michael, Look at a simliar issue reported at: http://rt.cpan.org/Public/Bug/Display.html?id=18699