#!/usr/bin/perl
#read each line in test1.txt into data_file array
$data_file="test1.txt";
open(DATA, $data_file) || die("Could not open file!");
@data_file=<DATA>;

#read each line in code.txt into a names_file array
$names_file="code.txt"
open(NAMES, $names_file) || die("Could not open file!");
@names_data=<NAMES>;

#create loop that reads each ID in code.txt (NAMES array), searches for
#each in array elements for test1.txt (DATA array), redirects a new
#(NAMES).html for each element
foreach ( $NAMES )
{
chomp($NAMES);
($NAMES=$DATA<0> > +("$NAMES<0>.html"));
}

close NAMES;
close DATA;