in reply to Please help

print: "Before: @array \n"

... is read as a label named print, followed by a string constant. Get rid of the colon after print.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)