#Document:
#!/usr/bin/ruby -w
print <<EOF
This is the first way of creating
here document ie. multiple line string.
EOF
print <<"EOF"; # 與上面相同
This is the second way of creating
here document ie. multiple line string.
EOF
print <<`EOC` # 執行指令
echo hi there
echo lo there
EOC
print <<"foo", <<"bar" # 您可以把它們進行堆疊
I said foo.
foo
I said bar.
bar
文法
BEGIN {
code
}
聲明 code 會在程式運作之前被調用。
文法
END {
code
}
聲明 code 會在程式的結尾被調用。