while () { chomp; # $_ is the default arg to chomp; # ... do other things to $_ if necessary ... push @a, $_; # add a new element at end of @a }