http://qs321.pair.com?node_id=126777


in reply to How to Put a Loop in my 1st Program

You want to use a while loop,
#!/usr/local/bin/perl open (TEXT,"general.txt") || die "Could not open file: $! \n"; $addthis=join("", <TEXT>); close (TEXT); open (FILES,"files.txt") || die "Could not open file: $! \n"; # Start to loop here??? or after the next group of statements? while ($line=<FILES>){ chomp $line; open (DATA,"$line") || die "Could not open file: $! \n"; $tothis=join("", <DATA>); close (DATA); $newrecord=$addthis.$tothis; open (DATA,">$line") || die "Could not write to: $! \n"; print "$line\n"; print DATA $newrecord; close (DATA); }