Re: hex-array print



joe.cipale@xxxxxxxxxxx wrote:
I am using perl to write a acript that will retreive SNMP data and
possibly modify SNMP values for a given object on a switch.

If I retreive the SNMP data using the standard Net-SNMP command
(snmpget), the data I see is:Hex-STRING:FF FF FF F0 00 00 00

If, on the other hand, I use the SNMP package written in perl, the data
is returned as such: yyy0.

I think you mean ÿÿÿð.

I have tried to have the data stored as an
array (@hex_data) and attempted to access the data by walking through
it one character at a time with no luck

pack() and unpack() were created for just such.

perl -le '$_="\xff\xff\xff\xf0"; print "$_ = ",unpack "H*",$_'
ÿÿÿð = fffffff0

	-Joe
.



Relevant Pages

  • Re: hex-array print
    ... possibly modify SNMP values for a given object on a switch. ... If, on the other hand, I use the SNMP package written in perl, the data ... Josef Möllers ...
    (comp.lang.perl.misc)
  • FAQ 7.22 How do I create a switch or case statement?
    ... If one wants to use pure Perl and to be compatible with Perl versions ... Here's a simple example of a switch based on pattern matching, ... The perlfaq-workers, a group of volunteers, maintain the perlfaq. ... operating system or platform, so please include relevant details for ...
    (comp.lang.perl.misc)
  • FAQ 7.23 How do I create a switch or case statement?
    ... If one wants to use pure Perl and to be compatible with Perl versions ... Here's a simple example of a switch based on pattern matching, ... The perlfaq-workers, a group of volunteers, maintain the perlfaq. ... operating system or platform, so please include relevant details for ...
    (comp.lang.perl.misc)
  • FAQ 7.23 How do I create a switch or case statement?
    ... If one wants to use pure Perl and to be compatible with Perl versions ... Here's a simple example of a switch based on pattern matching, ... The perlfaq-workers, a group of volunteers, maintain the perlfaq. ... operating system or platform, so please include relevant details for ...
    (comp.lang.perl.misc)
  • Re: TCL vs. Perl
    ... I don't understand why Perl doesn't have a 'switch' ... goto END; ... A 'C' switch/case statement is something different. ...
    (comp.lang.perl.misc)