From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: evaluation of perl in babel Date: Mon, 25 Feb 2013 07:11:03 -0700 Message-ID: <87vc9giimt.fsf@gmail.com> References: <87hal1whbc.fsf@mn.cs.uvic.ca> <87wqtxfjpb.fsf@Rainer.invalid> <87zjysu3b0.fsf@mn.cs.uvic.ca> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:42590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9yrL-0007Yy-Lt for emacs-orgmode@gnu.org; Mon, 25 Feb 2013 09:16:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U9yrK-0004Ue-7u for emacs-orgmode@gnu.org; Mon, 25 Feb 2013 09:16:51 -0500 Received: from mail-pb0-f50.google.com ([209.85.160.50]:53797) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U9yrK-0004UV-1X for emacs-orgmode@gnu.org; Mon, 25 Feb 2013 09:16:50 -0500 Received: by mail-pb0-f50.google.com with SMTP id up1so1690231pbc.9 for ; Mon, 25 Feb 2013 06:16:49 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: dmg Cc: emacs-orgmode@gnu.org dmg writes: > On Mon, Feb 25, 2013 at 1:54 AM, D M German wrote: >> >> Achim> You may misunderstand some things, or I don't understand what you are >> Achim> asking. It is (at least currently) the responsibility of the Perl >> Achim> program (or any other Babel language) to deliver the result in such a >> Achim> way that it can be interpreted correctly by the result type chosen (in >> Achim> other word, the program output must be valid Org syntax in the given >> Achim> context). You can't have the same program produce tables, vectors and >> Achim> LaTeX output just by switching the results type. >> >> I understand. But what I want is the output to be wrapped accordingly, >> and my script to deliver exactly the output as expected. So say I want >> to generate HTML in my script, I can use :results output, but then I >> have to change to replace the #+being_example with #+begin_HTML. >> >> I guess that I can generate a two dimensional table with perl too >> using output (printing the necessary | and \n), but then it will be >> wrapped with #+begin_example. > > Ok, I got it. What I need is to return a string with whatever I need. > A bit cumbersome, but I can live with it > It might be worth spending some time with the Org-mode manual. http://orgmode.org/manual/Working-With-Source-Code.html You could also use ":results org" or ":results raw", and then return raw Org-mode from your Perl script instead of html. Best, > > > #+begin_src perl :results html > " > a >
> " > #+end_src > > #+RESULTS: > #+BEGIN_HTML > > a >
> #+END_HTML > > thanks again for the explanation, -- Eric Schulte http://cs.unm.edu/~eschulte