App::bif::Editor - run a system (text) editor
0.1.5_8 (yyyy-mm-dd)
use App::bif::Editor; my $editor = App::bif::Editor->new(txt => $some_text); print "You edited the following:\n". $editor->result;
App::bif::Editor starts a system editor, optionally with text that you provide, or on a filename you provide, and allows you to retrieve the result.
This does basically the same thing as Proc::InvokeEditor, however it has much simpler and less code, has less dependencies, should work on Win32, defaults to unicode, and more importantly doesn't use system() so we can still do stuff while the editor is running. For example, timesheet tracking that is accurate even when the user suspends their laptop.
As an aide for testing, if STDOUT is not connected to a terminal then no editor will be started and the result
method will return the txt
attribute.
The new()
constuctor takes the following arguments.
auto
to a false value to inhibit this behaviour.@App::bif::Editor::EDITORS
.filename
attribute!filename
.Proc::FastSpawn, Proc::InvokeEditor
Mark Lawrence <nomad@null.net>
Copyright 2014-2017 Mark Lawrence <nomad@null.net>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.