Hi! Please consider following me on twitter: @hanekomu.

CPAN Gems: Proc::InvokeEditor

This is the first in a series of posts where I will show you CPAN modules I've stumbled across. If I find an interesting and well-documented module, I'll post the relevant part of the manpage.

Today, please take a look at Proc::InvokeEditor by Michael Stevens.

Proc::InvokeEditor - Perl extension for starting a text editor

use Proc::InvokeEditor;
my $edited_text = Proc::InvokeEditor->edit($unedited_text);

This module provides the ability to supply some text to an external text editor, have it edited by the user, and retrieve the results.

The File::Temp module is used to provide secure, safe temporary files, and File::Temp is set to its highest available level of security. This may cause problems on some systems where no secure temporary directory is available.

When the editor is started, no subshell is used. Your path will be scanned to find the binary to use for each editor if the string given does not exist as a file, and if a named editor contains whitespace, e.g. if you try to use the editor "xemacs -nw", then the string will be split on whitespace and anything after the editor name will be passed as arguments to your editor. A shell is not used but this should cover most simple cases.

Write a comment | Bookmark and Share

posted at: 09:11 | path: /cpan_gems | permalink | 0 comments | 0 trackbacks

Comments are closed for this story.

Trackbacks are closed for this story.