|
Тема |
Re: Dopuskane do link [re: Teшkapcko_koпeлe] |
|
Автор |
Yankoff (ъанкофф.) |
|
Публикувано | 12.06.03 19:24 |
|
|
Table 2.2: Numeric and String Comparison Operators Comparison
Comparison Numeric String
Equal == eq
You may wonder why there are separate operators for numbers and strings, if numbers and strings are automatically converted back and forth. Consider the two values 7 and 30. If compared as numbers, 7 is obviously less than 30, but if compared as strings, the string "30" comes before the string "7" (because the ASCII value for 3 is less than the value for 7), and hence is less. Perl always requires you to specify the proper type of comparison, whether it be numeric or string.
Nadqvam se znaesh english :)
ili s dve dumi kazano eq se izpolzva za string sravneniq a == za chisleni
Preporachvam ti eq za povecheto neshta osven ako ne rabotish s ogromni masivi/bazi/struckturi/..., v koito znaesh tipa danni.
Povecheto hora biha me upreknali, no tozi vupros e dosta osporvan v nqkoi golemi chujdi forumi i vseki si ima stil na rabota.
btw
$foo = 42; #tova e integer
$foo = "42"; #tova e string
ima razlika (ne samo kavichkite:))
__________________________
|
| |
|
|
|