#!/usr/bin/perl my ($file1,$file2); open(FILE1,"<$ARGV[0]"); while() { chomp($_); $file1 = $_; $file1=~s/\s+//; open(FILE2,"<$ARGV[1]"); while() { print "<$file1> \n"; } close FILE2; }