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 / 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 |
Perl uses single or double quotes to surround a zero or more characters. Are the single(' ') or double quotes (" ") identical?
Explain returning values from subroutines?
What are the advantages of programming in perl?
Write a program to show the process of spawning a child process
sort a word "system" in perl/shell without using built in functions output should be emssty
How to do comment in perl?
What is cpan in perl?
Explain the difference between "my" and "local" variable scope declarations. ?
Why do we use "use strict" in perl?
How do I print the entire contents of an array with Perl?
How to turn on Perl warnings? Why is that important?
How to close a file in perl?