Monday, November 23, 2009

perl: print EOF blocks syntax

Double quotes indicate that the text will be interpolated using exactly the same rules as normal double quoted strings.

Double quotes indicate that the text will be interpolated using exactly the same rules as normal double quoted strings.

print << EOF; The price is $Price.

EOF

print << "EOF"; # same as above

The price is $Price.

EOF

IF you need printf then to the following:
print <<EOF;
    ${foo}AAAAAAAA${foo}BBBBBBBB";
EOF
Here's another way to do it using printf:
printf <<EOF, $foo, $foo;
   %dAAAAA%dBBBBBBB 
EOF

No comments:

Post a Comment