in reply to How to open an editor from your Perl script?

For what it's worth, if this is a script that you plan on sharing with others, don't hard-code vim. Some people are very particular about their choice of text editor.

my $editor = $ENV{EDITOR} || 'vim'; system $editor => $filename;

$ENV{EDITOR} is a very commonly used environment variable. cron uses it for editing crontabs; most VCS software (svn, git, hg, etc) uses it for editing log messages; etc.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'