I have to say that perl and php are two very similar languages. For php students like me, it is easy to learn perl. Here are some differences between perl and php: variables: The Integer Variables on perl are actually stored in the floating-point register of the computer and viewed as floating-point numbers, that is, the integer value is floating.
I have to say that perl and php are two very similar languages. For php students like me, it is easy to learn perl. Here are some differences between perl and php: variables: The Integer Variables on perl are actually stored in the floating-point register of the computer and viewed as floating-point numbers, that is, the integer value is floating.
I have to say that perl and php are two very similar languages. For php students like me, it is easy to learn perl.
Here are some differences between perl and php that I have learned:
Variable:
The integer variables on perl are actually stored in the floating-point register of the computer and viewed as floating-point numbers. That is, the integer number is a special case of floating-point numbers. This should be the exclusive feature of perl, not only different from PHP, but also different from other languages I have ever seen.
OPERATOR:
Perl has a ** (Power) operator, while php needs to use the pow () function like C to perform power multiplication.
There is also an interesting comparison operator in perl: <=>, binary, returns-, 1, indicating that the Left value is less than the right value, and the left value is equal to the right value, the left value is greater than the right value. This is used for numbers. There is a string version: cmp, and the return value is the same as the number version. In php, only one character string comparison function strcmp ($ str1, $ str2) is similar to this comparison operator: Return negative value, 0, positive value, representing $ str less than, equal, greater than $ str2.
It is also interesting to see that the perl auto-increment (++) Auto-Subtract (-) symbol can be used on strings, such
$str= 'adc';++$str; #str=='add'
Perl strings can be repeated using x, for example
$str = 't' x 5; #str == 'ttttt'
The difference between strings and php is that strings in php can be connected through ",", but not in perl. ", similar to C.
Original article address: PHPer learning perl (1). Thank you for sharing it with me.