"Perl Programmers Reference Guide (англ.) (программ.) /19.12.1998/ " - читать интересную книгу автора


A word that has no other interpretation in the grammar
will be treated as if it were a quoted string. These are
known as "barewords". As with filehandles and labels, a
bareword that consists entirely of lowercase letters risks
conflict with future reserved words, and if you use the ----wwww
switch, Perl will warn you about any such words. Some
people may wish to outlaw barewords entirely. If you say

use strict 'subs';

then any bareword that would NOT be interpreted as a
subroutine call produces a compile-time error instead.
The restriction lasts to the end of the enclosing block.
An inner block may countermand this by saying no strict
'subs'.

Array variables are interpolated into double-quoted



14 perl 5.005, patch 02 14/Jun/98





PERLDATA(1) Perl Programmers Reference Guide PERLDATA(1)


strings by joining all the elements of the array with the
delimiter specified in the $" variable ($LIST_SEPARATOR in
English), space by default. The following are equivalent:

$temp = join($",@ARGV);
system "echo $temp";

system "echo @ARGV";

Within search patterns (which also undergo double-quotish
substitution) there is a bad ambiguity: Is /$foo[bar]/ to
be interpreted as /${foo}[bar]/ (where [bar] is a
character class for the regular expression) or as
/${foo[bar]}/ (where [bar] is the subscript to array
@foo)? If @foo doesn't otherwise exist, then it's
obviously a character class. If @foo exists, Perl takes a
good guess about [bar], and is almost always right. If it
does guess wrong, or if you're just plain paranoid, you
can force the correct interpretation with curly brackets
as above.