my @positions = (0); open FILE, '<', 'file' or die $!; while() { push @positions, tell FILE; }