#!/usr/bin/perl my ($file1,$file2); open(FILE1,"<$ARGV[0]"); open(FILE2,"<$ARGV[1]"); while() { chomp($_); $file1 = $_; $file1=~s/\s+//; #print "$file1 \n"; while() { print "<$file1> \n"; } } #### haai hru welcome hello thats gr8 select * from emp; file2.txt haai hru welcome hello thats gr8 select * from emp; select * from dual; #### haai hru welcome hello thatsgr8 select* from emp; #### <> <> <> <> <> <>