|Perl Monk, Perl Meditation|
Re: Shell v Perl, here-doc as stdinby dga (Hermit)
|on Apr 11, 2003 at 16:03 UTC||Need Help??|
I am not sure what you are asking exactly but here are a few possibilities.
As mentioned the here-document syntax is supported inside perl programs for data.
If you are wanting to send some input to 'system_command' then this could look really similar to a shell.
The | in front of the command tells perl to send anything printed onto that filehandle along to the program. Also if you have a newer perl you can use the 3 element open and lexical filehandles so the open could look more like:
Of course, in perl, TIMTOWTDI, so you can also have a variable with content to be passed along.
A perl script can be passed input via a here-doc from the shell just like any other command can recieve this data.
I hope one of these addresses the question that you had.