open(FIRST, $firstfile) or die $!;
open(SECOND, $secondfile) or die $!;
@first=<FIRST>;
@second=<SECOND>;
foreach $first_line(@first)
{
    foreach $second_line(@second)
    {
        chomp($first_line); chomp($second_line);
        print "$first_line$second_line\n";
    }
}

Agustin Rivera
Webmaster, Pollstar.com
http://www.pollstar.com



----- Original Message -----
From: "Peter Lemus" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 08, 2002 8:47 AM
Subject: add text to a file.....Help


> Hi,
> I have a file "1st file) that reads...
> one
> two
> three
> four
> five
>
> Anotherone "2nd file"that reads:
> day
> weeks
> months
> quarter
> year
> century
>
> I need to read the 2nd file and add the text from it
> to every word of the first 1st file. So it will look
> something like:
>
> oneday
> oneweek
> onemonth
> onequarter
> oneyear
> onecentury
> twoday
> twoweek etc..etc.
>
> Pleas give me an example on how I can accomplish this.
>
> thanks in advanced.
>
> =====
> Peter Lemus
> UNIX/NT Networks Engineer
> [EMAIL PROTECTED]
>
> --The universe is way too big for us to be alone; the real question is;
who is out-there, besides us "humans"?
> --A wise man will be master of his mind, a fool will be its slave.
Dr.David Schwartz.
> --Enjoy every moment of the day; Live like as if today was your last day
alive, and perhaps, it might be.
>
> __________________________________________________
> Do You Yahoo!?
> Send FREE video emails in Yahoo! Mail!
> http://promo.yahoo.com/videomail/
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to