in reply to
Here are a few comments on your existing code:
use strict; # always 'use strict'
use warnings; # always 'use warnings' or the -w switch
chomp (my @a = <DATA>); # chomp the array to get rid of extra \n's
my $file = "bas.txt";
# get the open() out of the loop so it's not repeated unnecessarily
open (FILE, ">>$file") || die "Can't open $file: $! \n";
print FILE "$_\n" for @a; # shorter; sweeter
I know that I'm not answering your question (it's been done), but those are a few other things to keep in mind for the future.
Zenon Zabinski | zdog | email@example.com