Function: org-babel-perl--var-to-perl

org-babel-perl--var-to-perl is a byte-compiled function defined in ob-perl.el.gz.

Signature

(org-babel-perl--var-to-perl VAR &optional VARN)

Documentation

Convert an elisp value to a perl variable.

The elisp value, VAR, is converted to a string of perl source code specifying a var of the same value.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ob-perl.el.gz
(defun org-babel-perl--var-to-perl (var &optional varn)
  "Convert an elisp value to a perl variable.
The elisp value, VAR, is converted to a string of perl source code
specifying a var of the same value."
  (if varn
      (let ((org-babel-perl--lvl 0) (lvar (listp var)))
	(concat "my $" (symbol-name varn) "=" (when lvar "\n")
		(org-babel-perl--var-to-perl var)
		";\n"))
    (let ((prefix (make-string (* 2 org-babel-perl--lvl) ?\ )))
      (concat prefix
	      (if (listp var)
		  (let ((org-babel-perl--lvl (1+ org-babel-perl--lvl)))
		    (concat "[\n"
			    (mapconcat #'org-babel-perl--var-to-perl var "")
			    prefix "]"))
		(format "q(%s)" var))
	      (unless (zerop org-babel-perl--lvl) ",\n")))))