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
What is the use of -w, -t and strict in Perl?
Write syntax to use grep function?
What is use of ‘->’ symbol?
Explain strftime() function in perl?
How can I display all array element in which each element will display on next line in perl ?
Why should I use the -w argument with my Perl programs?
Write a program to concatenate the $firststring and $secondstring and result of these strings should be separated by a single space.
What is the importance of perl warnings?
What happens in dereferencing?
Why to use perl?
what is the difference between java and cgi?
How to disable the mod_perl from apache_server as i have used perlfect search on the site and its pagination is not working and the remedy is to disable the mod_perl.
What exactly is grooving and shortening of the array?
Define operators used in perl?
What are stdin, stdout and stderr?