I have a function that takes in filename and prints the content of the file
#test.pl
while (<>) {
print $_;
}
exit(0);
I want to run this on the command line except instead of a filename I want to use the actual content as parameter without changing the script, similarly to an anonymous FIFO (e.g. "<(...)" operator in shell) to substitute a filename string with it's content?
<>can already read from stdin (btw, you should be using<<>>). What do you mean when you say "I have a function" ?bashshell you can do something like this:test.pl <<<"some content here which bash will supply on STDIN"