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

Explain which feature of PERL provides code reusability?

1218


Why to use perl scripting?

1012


What is lexical variable in perl?

943


How will you access an element of a perl array?

945


How interpreter is used in perl?

951


What does file test operators do in perl?

920


Explain about the applications of perl?

976


What $! In perl?

966


How to remove a directory in perl?

993


Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?

987


Why Perl aliases are considered to be faster than references?

951


Explain lists in perl?

979


What does localtime() do in perl?

1010


Explain perl. What are the advantages of programming in perl?

1044


Enlist the advantages of using c over perl?

918