I have a shell script consisting of so many perl scripts, one of the perl script have to be run with differnt input each time and the value has to be stored in a single file at the end as shown
#!/bin/sh
.....
....
perl test.pl apple
perl test.pl mango
perl test.pl banana
...
...
....
I type these names in command lines by looking at the file generated with these names.
**names.txt**
apple
mango
banana
OR
**names.txt**
apple mango banana
Is their a way in perl or shell which takes each name at a time as an input.
That is can names.txt be considered as an array and then the perl script take each array value at a time as an input using ARGV or any other means.So that i can have my shell script like
#!/bin/sh
.....
....
perl test.pl names.txt
....
...
....