[EMAIL PROTECTED] wrote:

> This is my first attempt.   My misunderstanding was in the fact that I could
> put the filehandles inside another filehandles while loop.
>
> #!perl
> use strict;
> &read_the_files;
> sub read_the_files{
> print "\nread_the_files";#
> my$file1 ="./file1.txt";
> #contents of file1.txt
> #1;;;;
> #6;;;;
> my$file2 = "./file2.txt";
> #contents of file2.txt
> #;;;;5
> #;;;;10
> my$file3 = "./file3.txt";
> #contents of file3.txt
> #;;;4;
> #;;;9;
> my$file4 = "./file4.txt";
> #contents of file3.txt
> #;;;;5
> #;;;;10

Hold it!  You're doing all this work to somehow combine a total of eight lines of
text?  This does not make sense.  Please post some real data and an
English-language explanation of how the contents of the files relate to each
other.  Is it a line-by-line correlation?  What are all the serial semicolons
for?  Are they empty field delimiters?  If so, there is no good reason to inject
anything into them.  Perl can handle null strings just fine when splitting.  I
try to be kind to myself though, by following delimiters with a space in
text-based data files.  perl can also handle a little well-placed white space
quite easily.

Think your problem our in words first.  Articulate it carefully.  The code can
come almost effortlessly once the logic is worked out.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to