Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What does a die() function do in perl?

931


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

921


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

849


Explain perl. When do you use perl for programming? What are the advantages of programming in perl?

824


What is goto statement in perl?

889


Is perl compiler or interpreter?

887


Explain arrays in perl.

880


Explain which feature of PERL provides code reusability?

1152


Why do we use "use strict" in perl?

913


Write a program that explains the symbolic table clearly.

911


What are the various flags/arguments that can be used while executing a perl program?

814


Explain lists in perl?

925


What does Perl do if you try to exploit the execve(2) race involving setuid scripts?

889


Define dynamic scoping.

829


Write a program to decode the data in the form using cgi programming

984