"..if you see a blatent flaw in my logic.."
Not a flaw in your logic per se, but more a comment on the way you are opening your files.
It is generally accepted that the three argument form of open is a better choice. That is, instead of doing:
..you do:open (FH, "< $parent_index") or die "could not open file $parent_inde +x for reading:$!";
open (FH, '<', $parent_index) or die "could not open file $parent_ind +ex for reading:$!";
The main advantage of this is that it separates the mode from the filename, thereby avoiding any confusion between the two (ie. what if the filename begins with "<" ?). It also forces you to be explicit about which mode you want - again avoiding any possible confusion.
And if you are using Perl 5.8.0+, you can even do:
open (my $fh, '<', $parent_index) or die "could not open file $parent +_index for reading:$!";
See the documentation for open for further reading, and this topic is also covered quite well in Intermediate Perl, if you happen to have a copy.
Hope this helps,
Darren :)
In reply to Re: handling different new line characters
by McDarren
in thread handling different new line characters
by mav3067
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |