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 |
What are the various perl data types based on the context?
For a situation in programming, how can you determine that Perl is a suitable?
How can you replace the characters from a string and save the number of replacements?
What value is returned by a lone `return;’ statement?
What is the difference between perl list and perl array?
Write a program that explains the symbolic table clearly.
What is the difference between module and package?
“The methods defined in the parent class will always override the methods defined in the base class”. What does this statement means?
What is q (single q) operator in perl?
What is posix in perl?
What is the tk module?
what is the difference b/w coldfusion MX 6 and Coldfusion MX 7?