in reply to foreach on array

Hi,
    From your scrip : push @inpfile, [split /\n/];

    The wrong is: 
    Split function return a list. Then the list is assign to array element.
    

Try this one

while (<APPLIST>) {
        chomp;
	push @inpfile, $_;
}

or simply

@inpfile = <APPLIST>; #store each line from a file into array