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
Explain which feature of PERL provides code reusability?
Why to use perl scripting?
What is lexical variable in perl?
How will you access an element of a perl array?
How interpreter is used in perl?
What does file test operators do in perl?
Explain about the applications of perl?
What $! In perl?
How to remove a directory in perl?
Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?
Why Perl aliases are considered to be faster than references?
Explain lists in perl?
What does localtime() do in perl?
Explain perl. What are the advantages of programming in perl?
Enlist the advantages of using c over perl?