in reply to File handles and loops
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: File handles and loops
by Anonymous Monk on Jul 31, 2012 at 08:43 UTC | |
by Corion (Patriarch) on Jul 31, 2012 at 08:45 UTC |