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 is the use of -w, -t and strict in Perl?

977


Write syntax to use grep function?

950


What is use of ‘->’ symbol?

992


Explain strftime() function in perl?

918


How can I display all array element in which each element will display on next line in perl ?

908


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

952


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

1035


What is the importance of perl warnings?

1113


What happens in dereferencing?

1020


Why to use perl?

929


what is the difference between java and cgi?

1049


How to disable the mod_perl from apache_server as i have used perlfect search on the site and its pagination is not working and the remedy is to disable the mod_perl.

2219


What exactly is grooving and shortening of the array?

997


Define operators used in perl?

924


What are stdin, stdout and stderr?

1084