piping

I am using pipes (specifically piping out) in Perl to put an array from one file into an array in a different file. I can't figure out how to transfer the array. I kow how to open the pipe : open (FILEHANDLE, "| file") or die~
but how do I transfer the array. I think it has something to do with this error that keeps on appearing when I execute:

Name "main::DIRECTORY" used only once: possible typo at ./draft2.pl line 38.

May be this will be appropriate
open (FILEHANDLE, ">> file") or die;
or
open (FILEHANDLE, "> file") or die;
If you create a pipe with mknod file p you cannot use | file syntax, > file must be used in any case