Hi All,

I have a C program which i want to convert it into perl
In the C program it is given like this

typedef unsigned short          u_int16;
#define dataLen         4
#define keyLen          52
#define userkeyLen       8
#define DataT(v)  u_int16 v [dataLen]
#define keyT(v)   u_int16 v [keyLen]
#define UserKeyT(v)  u_int16 v [userKeyLen]


void function(DataT(dataIn), DataT(dataOut), keyT(key));

how can i convert the above lines into perl scripts, i thought that getting 
the datalen from the input would solve the problem but how to get the 
datalen of that variable in PERL?

Also is there a way that i can convert the datalen into binary format
is yes how?

Any one have any idea?

This is second question:

I know that if i want to XOR two data
then i have to use "^"
I have a PERL script which is like this

print "Enter number: ";
chomp($number = <STDIN>);
print "Enter another number: ";
chomp($num = <STDIN>);

$value = $number ^ $num;
print "the value is $value\n;

is there any mistake in the above script, i know it is dumb, reason i am 
asking is this
it doesnt print any value and if i use xor instead of ^
$value = "$number" xor "$num"
it shows me a warning saying that useless use of xor
Where am i making mistake ?

But the first mentioned script works well for "&" and "||" but not for "^" 
why though?

please enlighten me on these two aspects






:wq Prabhu
################################################
Never write it in 'C', if you can do it in 'awk';
Never do it in 'awk', if 'sed' can handle it;
Never use 'sed' when 'tr' can do the job;
Never invoke 'tr' when 'cat' is sufficient;
Avoid using 'cat' whenever possible;
    - Laws of programming.
################################################


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to