Remove timestamp from multiple filename

could you pls help me out in PERL

i have a requirement like

a.dat.<timestamp> 
b.dat.<timestamp> 
c.dat.<timestamp>  

can you pls help me to rename/remove timestamp

a.dat 
b.dat 
c.dat  

Is there any way to remove timestamp alone
Thanks

for i in *.dat.?*
do
mv "$i" "${i%.*}"
done
# ls *dat*
a.dat.<timestamp>  b.dat.<timestamp>  c.dat.<timestamp>  d.dat
# ls *dat.?*
a.dat.<timestamp>  b.dat.<timestamp>  c.dat.<timestamp>
# for i in *dat.?*
> do
> echo "mv $i ${i%.*}"
> mv $i ${i%.*}
> done
mv a.dat.<timestamp> a.dat
mv b.dat.<timestamp> b.dat
mv c.dat.<timestamp> c.dat
# ls *dat*
a.dat  b.dat  c.dat  d.dat
#

Can you pls let me know what needs to be done for this error when tried to executing

Missing $ on loop variable at line 1.

Thanks in advance

please copy paste the code you used so we can check if we see something wrong.

by the way, which plateform and which shell are you using ?