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 / 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 |
What are the various file operations in perl. Explain with example.
Define operators used in perl?
I have one question regarding to eval function. I know eval function is use for error checking but I am not able to understand below line. eval \'exec perl -S $0 ${1+\"$@\"}\' if 0; $0 for script name $@ set if error occur
When does circular reference occur?
what r the different type of function in perl ???
Can any1 tell me 2 write the script using perl script 2 looking at a log file 2 see wheather the test has passed or not.
Explain different types of perl operators.
How to read a single line from a file in perl?
Differences between die and exit.
Comment on array slicing and range operator
Write a cgi program to show the header part?
What does `$result = f() .. g()' really return?