in reply to "chomp" not working

chomp doesn't change the array because there is no newline in the array. split returns what's separated by the separator.

+------------------> $arr1[0] = "aaa"; | +-------------> $arr1[1] = "bbb"; | | +--------> $arr1[2] = "ccc"; | | | +----> empty field dropped | | | | --- --- --- - aaa\nbbb\nccc\n