#!/usr/bin/perl -w while(<STDIN>) { chomp; @words = split; foreach $w (@words) { $key = $w; $value = "1"; print "$key\t$value\n"; } }