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 is boolean context?
Explain the difference between use and require?
What is the closure in PERL?
Write an expression or perl script to identify the entered ip address is valid or not?
Differences between die and exit.
What does length(%HASH) produce if you have thirty-seven random keys in a newly created hash?
Write a script to reverse a string without using Perl's built in function
What is epoch time in perl?
What is goto statement in perl?
Explain the default scope of variables in perl?
Explain lists in perl?
Explain use of ‘my’ keyword in perl?