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



Packing and Unpacking. Hi, I want to get output as 0x23400000345.... in the below example How t..

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

Post New Answer

More CGI Perl Interview Questions

What is v-strings?

0 Answers  


How does a “grep” function perform?

0 Answers  


How do you turn on the perl warnings?

0 Answers  


What does the command "use strict" do and why should you use it?

2 Answers   Symphony, TCS,


What is the purpose of _package_ literal?

0 Answers  






How would you ensure the re-use and maximum readability of your perl code?

0 Answers  


Explain strftime() function in perl?

0 Answers  


What is the importance of perl warnings?

0 Answers  


What are the reasons that cookie server can’t handle multiple connections?

0 Answers  


What is a hash?

6 Answers   Photon, Satyam, Wipro,


what are prefix dereferencer and list them out?

0 Answers  


Explain ivalue?

0 Answers  


Categories