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...  ;-)

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

    In addition, this

    my $editor = $ENV{'editor'}; system('vim', $my_file);

    should be like this:

    my $editor = $ENV{'EDITOR'} || 'vim'; system($editor, $my_file);

      Also consider Proc::InvokeEditor. It doesn't work as nicely on Windows, as it doesn't have notepad.exe as the fallback editor there, but if you have vi(m) somewhere, it'll get used.