>>333
- @readarray = split(/\s|,/ ,$readline);
+ @readarray = split(/\s*,\s*/ ,$readline);

これでどうでしょ?