foreach (@lines) { @results = split; # splits on whitespace ... # do stuff with results } #### foreach (@lines) { @results = split /\|/; # splits on pipe char ... # do stuff with results }