Hi all,

In the below program, i give in the hash as

%TypeofNumber  = ( 0b00 => Integer, 0b01 => Floating, 0b10 => Char, 0b11 =>
Double );

Using this hash i need to priont the appropriate combination....

How to do that?

Thanks and Regards,
Dharshana

On 11/13/06, Dharshana Eswaran <[EMAIL PROTECTED]> wrote:

Hi all,

I am working on the code below....

use strict;
use warnings;

my $hex = "43";

my $binary = unpack 'B*', pack 'H*', $hex;

print "$binary\n\n";

my @fields = unpack 'A2A2A4', $binary;

my $i;
printf "%-4s => %s\n", $fields[$i++], $_ foreach qw/Ext TypeofNumber
NumberingPlan/;

**OUTPUT**

01000011

01 => Ext
00 => TypeofNumber
0011 => NumberingPlan

But, now i have a hash(associative array),

%TypeofNumber  = ( 00 => Integer, 01 => Floating, 10 => Char, 11 => Double
);

Using this hash, the type of number has to be specified in the output.

As shown here:
01 => Ext

TypeofNumber
00 => Integer

0011 => NumberingPlan


I am unable to get the desired output?


Thanks and regards,
Dharshana



Reply via email to