#!/usr/bin/perl # The Missing Textutils, Ondrej Bojar, obo@cuni.cz # http://www.cuni.cz/~obo/textutils # # 'tuples' makes tuples: every n consecutive lines joined on 1 line, delimited # with a tab. # # $Id: tuples,v 1.2 2005/10/10 07:33:50 bojar Exp $ # use strict; my $tuple = 2; my @line =(); while (<>) { chomp; push @line, $_; if (@line == $tuple) { print join("\t", @line)."\n"; @line = (); } }