note
bart
I'm going to take your title as a question, irrespective of any interpretation of what you really want to achieve. Can you instert extra text, say, from a text file, into the perl input via STDIN? Well, yes you can.
<p>If you set <c>@ARGV</c> to the paths of a number of files, <code>while(<>)</code> will read the files <em>instead of</em> STDIN. But add "<code>-</code>" (that's a minus sign) as a file namen, and perl will also read from normal STDIN.
<p>In summary: the following snippet will read a saved text file <em>and</em> input from STDIN.
<p><code>
@ARGV = ('grocery_list.txt', '-');
while(<>) {
print " * $_";
}
</code>
<p>This will read from STDIN until you somehow terminate it: read from a finite pipe, or enter ctrl-D or ctrl-Z interactively, depending on the platform.
11115029
11115029