in reply to incorrect output
in thread foreach loops

u have to initialize as
@a=(1,2,3,4,5)
or each element within double quotes