Hello dr.jekyllandme,
Neighbour has dealt with the main problem — the inappropriate recursion — in your code. However...
If anyone can give me pointers how to improve my code, it would be great. Thank you.
Well, since you asked... ;-)
open(my $fh, '>', 'my_file.txt');
after every open and close.or die "...";
edit_file('my_file.txt');
open(my $fh, '<', $myfile) or die "Unable to open file\n"; while (<$fh>) { chomp; # <-- here and unless (/^[a-z]/) # <-- here { ...
HTH,
Athanasius <°(((>< contra mundum
In reply to Re: File handles and loops
by Athanasius
in thread File handles and loops
by dr.jekyllandme
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |