Mercurial > vim
diff runtime/doc/eval.txt @ 7651:c7575b07de98 v7.4.1125
commit https://github.com/vim/vim/commit/e9b892ebcd8596bf813793a1eed5a460a9495a28
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 17 21:15:58 2016 +0100
patch 7.4.1125
Problem: There is no perleval().
Solution: Add perleval(). (Damien)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 17 Jan 2016 21:30:04 +0100 |
parents | befbed72da87 |
children | d4370fef0175 |
line wrap: on
line diff
--- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.4. Last change: 2016 Jan 16 +*eval.txt* For Vim version 7.4. Last change: 2016 Jan 17 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1950,6 +1950,7 @@ nextnonblank( {lnum}) Number line nr of nr2char( {expr}[, {utf8}]) String single char with ASCII/UTF8 value {expr} or( {expr}, {expr}) Number bitwise OR pathshorten( {expr}) String shorten directory names in a path +perleval( {expr}) any evaluate |Perl| expression pow( {x}, {y}) Float {x} to the power of {y} prevnonblank( {lnum}) Number line nr of non-blank line <= {lnum} printf( {fmt}, {expr1}...) String format text @@ -4778,6 +4779,17 @@ pathshorten({expr}) *pathshorten()* < ~/.v/a/myfile.vim ~ It doesn't matter if the path exists or not. +perleval({expr}) *perleval()* + Evaluate Perl expression {expr} in scalar context and return + its result converted to Vim data structures. If value can't be + converted, it returned as string Perl representation. + Note: If you want a array or hash, {expr} must returns an + reference of it. + Example: > + :echo perleval('[1 .. 4]') +< [1, 2, 3, 4] + {only available when compiled with the |+perl| feature} + pow({x}, {y}) *pow()* Return the power of {x} to the exponent {y} as a |Float|. {x} and {y} must evaluate to a |Float| or a |Number|.