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