in reply to from txt file to array

yes it is possible using chomp and push while iterating DATA

You can also assign an undef value to $/ and assigning directly <DATA> to an array. Infact the diamond operator in list context will fill your array.

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.