#!/usr/bin/perl
# The Missing Textutils, Ondrej Bojar, obo@cuni.cz
# http://www.cuni.cz/~obo/textutils
#
# 'prefix' prepends every line with ARG1.
#
# $Id: prefix,v 1.5 2006/08/04 22:15:00 bojar Exp $
#

use strict;
use Getopt::Long;

my $tab = 0;
GetOptions("tab"=>\$tab) or exit(1);

my $prefix = shift;
die "usage: prefix <prefix>  < infile   > outfile" if ! defined $prefix;

$prefix =~ s/\\t/\t/g;
$prefix =~ s/\\n/\n/g;
$prefix =~ s/\\\\/\\/g;
$prefix .= "\t" if $tab;
while (<>) {
  print $prefix.$_;
}
