Run perl script with multiple file arguments

Hello everyone,

I have two types of files in a directory:

*.txt
*.info

I have a perl script that uses these two files as arguments, and produces a result file:

perl myScript.pl abc.txt abc.xml 

How can I run this script (in a "for" loop , looping through both types of files) with multiple arguments using shell scripting?

Please suggest!

Guess your files are always in pair of *.txt and *.xml. (not sure the *.info, you can adjust by yourself)

for file in $(ls *.txt)
do
  name=${file%%.txt}
  perl myScript.pl $file $name.xml
done

Sorry *.info was a typo...
Its *.txt and *.xml.

Thanks !!!

---------- Post updated 07-16-10 at 08:19 AM ---------- Previous update was 07-15-10 at 08:23 PM ----------

I am not able to run the above script as it is giving me a bad substitution error??
I tried running it with both bash and tcsh.

Please help!!
thanks!

what platform and shell do you use?

#!/bin/sh
for i in `ls *.txt`
do
file=`awk -F'.' '{print $1}'`
perl myScript.pl ${file}.txt ${file}.xml
done