Самые последние сообщения с ярлыком scalar. Показать более ранние сообщения
Самые последние сообщения с ярлыком scalar. Показать более ранние сообщения

вторник, 24 ноября 2009 г.

Perl :: Data Structures :: Scalar :: Perl scalar value

First, Perl uses the special mark to designate a scalar variable and it is '$' (dollar sign). As the Perl father says, he has picked this one just because it looks like 's' that can stand for 'scalar' and it comes handy indeed. But, on the other hand, recalling Larry Wall's linguistic background it is in place to say that 's' may stand for 'singular', too. This is especially important to keep in mind, when one is using it in Perl scripting as any scalar variable in Perl can keep only 'single' value. The real thing about everything in Perl lies near the context, which may make one 'miserable' unless one knows what the context in Perl is.

One more general thing about variable names in Perl, starting not so long before, unlike in many other languages the programmer can give names to his babies and beasts in his native language belonging to, say, Slavonic, Sino-Tibetian, Judaeo-German or any other family. Here are our special thanks to the Unicode team. It does not make much from efficacy point of view, but adds a lot to the readability of the source code.

The Perl scalars may look like '$var', and all; or, if one prefers Chinese flavour, he might write something like this: $輕 (qìng - easy, light).

FYI: (%perldoc) perldata - Perl data types