Packing and Unpacking.
Hi, I want to get output as 0x23400000345....
in the below example
How to get?
i tried out, but unable to get the answer
$r=0x234;
$t=0x345;
$y=pack('L L',$t,$r);
$x1=unpack('L!',pack('P',$y));
printf("\nThe value is $x1");
I didn't get constant output
Answer Posted / kiruthikau
use the following code.
<code>
use bigint;
my $r = 0x234;
my $t = 0x345;
my $x1 = $r << 32 | $t;
print $x1->as_hex;
</code>
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Write a program to decode the data in the form using cgi programming
Differentiate between c++ and perl.
Explain grooving and shortening of arrays and splicing of arrays?
what is the function of Return Value?
What is grep used for in perl?
Explain ivalue?
How many types of primary data structures in Perl and what do they mean?
How and what are closures implemented in perl?
what is Chop & Chomp function does?
Write a program to concatenate the $firststring and $secondstring and result of these strings should be separated by a single space.
What package you use to create a windows services?
What does a die() function do in perl?
Differences between die and exit.
What are the features of perl language?
How we can navigate the xml documents?