Term::CallEditor - solicit for data from an external Editor
use Term::CallEditor; my $fh = solicit('FOO: please replace this text'); die "$Term::CallEditor::errstr\n" unless $fh; print while <$fh>;
This module calls an external editor with an optional text message and returns what was input as a file handle. By default, the EDITOR environment variable will be used, otherwise
$Term::CallEditor::errstr for details.
- Pass in a block of text to the editor.
my $fh = solicit(<< "BLARB"); FOO: This is an example designed to span multiple lines for the sake FOO: of an example that span multiple lines. BLARB
- Support bbedit(1) on Mac OS X.
To use bbedit(1) as the EDITOR, create a shell script wrapper to call bbedit(1) as follows, then set the wrapper as the EDITOR environment variable.
#!/bin/sh exec bbedit -w "$@"
Jeremy Mates, <email@example.com>
Copyright 2004 by Jeremy Mates
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Version control systems like CVS and Subversion have similar behaviour to prompt a user for a commit message, which this module is inspired from.