#!/bin/perl use warnings; use strict; use Data::Dump qw(pp); while(){ my @points = map{ s/\s+// } split("\t", $_); print "\n\@points =\n", pp \@points; #More code here } __DATA__ 0.000 12 0.232 13 11 text that can have space 1.000 13 0.534 14 12 More text that would be ok 2.000 14 0.876 15 13 yet more text