L
lynn.newton
There is a question at the end of this, but bear with me while I
present a little background explaining why the question
came up.
Years ago I became aware that in the Bourne shell using this
syntax:
cat <<EOF
$something
EOF
resulted in creating of a temporary file in /tmp with the text
in it. I doubtthat in today's world of abundant memory that this
is still true in any standard Unix or Linux shell, but as long as it
was, using that syntax resulted in the overheadof undesireable
disk activity that probably most people never knew about.
In Perl, of course one may use similar syntax:
print <<EOF;
$something
EOF
which can be useful particularly if $something is long and
contains formatting,such as in returning HTML code to a browser.
So what I am wondering is whether anyone knows the technical
difference of what goes on internally whether I choose to use:
print qq($something);
versus
print <<EOF;
$something
EOF
I certainly believe Perl does not use temporary disk files.
But intuitively, I am inclined to use the quoted style rather
than <<EOF here documents wherever I can.
present a little background explaining why the question
came up.
Years ago I became aware that in the Bourne shell using this
syntax:
cat <<EOF
$something
EOF
resulted in creating of a temporary file in /tmp with the text
in it. I doubtthat in today's world of abundant memory that this
is still true in any standard Unix or Linux shell, but as long as it
was, using that syntax resulted in the overheadof undesireable
disk activity that probably most people never knew about.
In Perl, of course one may use similar syntax:
print <<EOF;
$something
EOF
which can be useful particularly if $something is long and
contains formatting,such as in returning HTML code to a browser.
So what I am wondering is whether anyone knows the technical
difference of what goes on internally whether I choose to use:
print qq($something);
versus
print <<EOF;
$something
EOF
I certainly believe Perl does not use temporary disk files.
But intuitively, I am inclined to use the quoted style rather
than <<EOF here documents wherever I can.