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 does a die() function do in perl?
How do I replace every TAB character in a file with a comma?
How will you open a file in read-only mode in perl?
Explain perl. When do you use perl for programming? What are the advantages of programming in perl?
What is goto statement in perl?
Is perl compiler or interpreter?
Explain arrays in perl.
Explain which feature of PERL provides code reusability?
Why do we use "use strict" in perl?
Write a program that explains the symbolic table clearly.
What are the various flags/arguments that can be used while executing a perl program?
Explain lists in perl?
What does Perl do if you try to exploit the execve(2) race involving setuid scripts?
Define dynamic scoping.
Write a program to decode the data in the form using cgi programming