On 7/4/07, Bernard <[EMAIL PROTECTED]> wrote:

When I try to get the arp table from any type of device (oid
1.3.6.1.2.1.4.22.1.3) with the snmp_util module, it  returns the 6
character, instead of the hex byte value.

How can I convert a 6 byte word into the hex equivalent like
00:0a:8b:bd:62:8a.

Maybe you want something like this?

 sub make_hex_string {
   my $str = unpack "H*", shift @_;
   $str =~ s/(..)/:$1/g;
   $str =~ s/^://;
   $str;
 }

But if the module you're using doesn't supply the function you need,
maybe a different module would help.

Good luck with it!

--Tom Phoenix
Stonehenge Perl Training

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to