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

Differentiate between arrays and list in perl.

0 Answers  


Explain about typeglobs?

0 Answers  


how to install a package in perl ????

2 Answers  


How do I replace every TAB character in a file with a comma?

0 Answers  


Name an instance where you used a CPAN module?

3 Answers   IBM, TCS,






Explain lists and ivalue?

0 Answers  


How will you open a file in a write-only mode in perl?

0 Answers  


Why should I use the -w argument with my Perl programs?

0 Answers  


Explain splicing of arrays?

0 Answers  


How to read file into hash array ?

0 Answers  


what r the future opportunities in PERL/LINUX after 3 years ??

3 Answers  


What are the different instances used in cgi overhead?

0 Answers  


Categories