sponsor Vim development Vim logo Vim Book Ad

perl_io.vim : Perl : using 'print' and 'printf' instead of 'VIM::Msg'

 script karma  Rating 13/4, Downloaded by 787  Comments, bugs, improvements  Vim wiki

created by
Serguei Jidkov
 
script type
utility
 
description
This plugin uses 'Tie::Handle' mechanism to create two output handles: VIMOUT and VIMERR. Then standard output is
associated with VIMOUT. This allows normal use of 'print' and 'printf' operators:

:perl << EOP
print 'Line:', $curwin->(Cursor())[0];
printf '%d:%d", $curwin->Cursor();
print VIMERR "Error: $!";
EOP

Value in $, is handled correctly:

:perl $, = '; ';
:perl print 'a' .. 'e'; # prints 'a; b; c; d; e'

Value in $\ is ignored and  there is no buffering, so it works as if $\ was set to "\n":

:perl print 'one'; print 'two'

prints same as

:perl print "one\ntwo"
 
install details
Drop in your plugin directory.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
perl_io.vim 0.1 2001-11-15 6.0 Serguei Jidkov Initial upload
ip used for rating: 3.141.8.247

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github