开发者

What does LOC and ACC mean in perl?

For filling content of file in perl there are several ways. And two开发者_开发问答 of them are followings:

1.

print $file_handle1 <<LOC
this is content of first file
LOC
;

2.

print $file_handle2 <<ACC
this is content of second file
ACC
;

So what is the difference (if there are any) between LOC and ACC?


They are just names, they do exactly the same thing. You can use anything you want there.

This syntax is called here documents, and it's not specific to perl.

print <<HELLO;
Good Bye
HELLO


There isn't any difference (at least as far as Perl is concerned). That is heredoc syntax, you can use any value as the end of block indicator.


They don't mean anything. They are delimiters for multi-line text.

For more information, Google perl here-doc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜