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

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

1099


Differentiate between c++ and perl.

1057


Explain grooving and shortening of arrays and splicing of arrays?

951


what is the function of Return Value?

1126


What is grep used for in perl?

979


Explain ivalue?

1052


How many types of primary data structures in Perl and what do they mean?

1468


How and what are closures implemented in perl?

952


what is Chop & Chomp function does?

1040


Write a program to concatenate the $firststring and $secondstring and result of these strings should be separated by a single space.

1105


What package you use to create a windows services?

935


What does a die() function do in perl?

1034


Differences between die and exit.

1040


What are the features of perl language?

1153


How we can navigate the xml documents?

1069