>>>>> "SD" == Steve D <> writes:
SD> open (MASTER_IN, "<$file_name") ||
SD> die "unable to open $file_name file $!";
SD> binmode(STDOUT);
SD> binmode(MASTER_IN);
SD> print STDOUT <MASTER_IN>;
that will read in all of the file and print it.
SD> @master_array = <MASTER_IN>;
what do you think is happening with that line? you have already read in
the file. handles can't figure out where you want to read from. you have
to open the file again or seek to the beginning to read it all in.
better yet, why do you want to read it all in twice? just read it into
an array and then print it or mung it. you have it backwards, printing
directly from the handle and then trying to read it in again.
and assuming a file is binary and then reading it in as lines makes
little sense. lines are normally found in text files. binary files can
have newlines in them but no guaratees of where and how many. i think
you need to rethink your whole solution.
uri
--
Uri Guttman ------
--------
http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ----------------------------
http://jobs.perl.org