tritt has asked for the wisdom of the Perl Monks concerning the following question:
Hi, Is there a nicer way of doing this?
use constant XXX => 0xcccc; ($self->{auth_mode}, $val) = unpack('H4a*',$val); $self->{auth_mode} = hex($self->{auth_mode}); given ($self->{auth_mode}) { when (XXX) {do_smthg;} }
Thanks in advance :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Nicer hex-unpack
by Corion (Patriarch) on Jul 12, 2011 at 09:05 UTC | |
|
Re: Nicer hex-unpack
by TomDLux (Vicar) on Jul 14, 2011 at 19:33 UTC |