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
In Perl we can show the warnings using some options in order to reduce or avoid the errors. What are that options?
Does Perl have reference type?
Differentiate between arrays and list in perl.
What is an interpolation in perl?
How to merge two arrays in perl?
Explain grooving and shortening of arrays?
What are the different ways to run cgi?
How will you get the count of parameters passed to a perl subroutine?
What is the difference between perl list and perl array?
Explain the meaning of closure in perl.
Differentiate between use and require, my and local, for and foreach and exec and system
There are some duplicate entries in an array and you want to remove them. How would you do that?
What $! In perl?
How do you set environment variables in perl?
Explain what is lvalue?