In Perl, filehandle is a data type, and I would expect a variable of this type to have some kind of sigil prefix. However, the following code (2nd open) shows that this is not the case
open my $fileHandle, '>', "out.txt"; open FH, '>', "out2.txt";
I found that the second form of confusion / inconsistency. What is the reason for resolving the second form?
, . , . glob glob, filehandle filehandle. ( ).
.
, .
my $fh = STDOUT; # XXX Short for: my $fh = "STDOUT"; my $fh = *STDOUT; # ok
, glob (, open, print, readline aka <> ..), .
open
print
readline
<>
print STDOUT "foo\n"; # Short for: print *STDOUT "foo\n";
*.
*
sub foo { } sub bar(*) { } foo(STDOUT); # XXX Fails when using "use strict;" bar(STDOUT); # ok
?
( ) open(my $fh, ...), 5.6. , (my) . , open(FH, ...) .
open(my $fh, ...)
my
open(FH, ...)
Source: https://habr.com/ru/post/1662074/More articles:Mongoose async / wait for Koa to get stuck waiting for Model.findOne (). Exec () - node.jsSpring Download 1.4.2 @WebMvcTest returns status 404 - javaFailed to load DLL 'api-ms-win-core-registry-l1-1-0.dll' - .netитерация по pandas файлу данных в jinja2 - pythonHow to use Repo.get with a choice like in Repo.one - elixirWhat is the default value for an instance variable of type Enum in Java? - javaКак скрыть текст, который не имеет тегов, нет идентификатора, нет класса? - jqueryСложность времени этого цикла - cпривязка кода OCaml с общей библиотекой - haskellЧто делает ключевое слово Haskell "делать"? - syntaxAll Articles