Показать сообщение отдельно

  #9  
Старый 30.08.2009, 11:55
geezer.code
Reservists Of Antichat - Level 6
Регистрация: 22.01.2007
Сообщений: 616
Провел на форуме:
7452489

Репутация: 1359


По умолчанию

Цитата:
Сообщение от Flcn  
А что означает вот этот код?
Код:
aString = <<END_OF_STRING
    The body of the string
    is the input lines up to
    one ending with the same
    text that followed the '<<'
END_OF_STRING
а то я что то не догнал..
особенно вот такой пример
Код:
print <<-STRING1, <<-STRING2
   Concat
   STRING1
      enate
      STRING2
ммм... на каком уровне ты знаешь английский ?
в первом коде дано объяснение
The body of the string
is the input lines up to
one ending with the same
text that followed the '<<'
то есть '<<' - метка начала строки, а то что написано за ней END_OF_STRING - метка окончания строки.

Дальше по тексту
A here document consists of lines in the source up to, but not including, the terminating string that you specify after the << characters. Normally, this terminator must start in the first column. However, if you put a minus sign after the << characters, you can indent the terminator.
то есть метка конца строки не должна иметь индентацию, но если это нужно перед меткой надо написать "-"