emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: D M German <dmg@uvic.ca>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] bug in expansion of variables in babel Perl
Date: Mon, 25 Feb 2013 13:54:37 -0800	[thread overview]
Message-ID: <87bob8rrdu.fsf@mn.cs.uvic.ca> (raw)
In-Reply-To: <loom.20130225T134606-26@post.gmane.org> (Achim Gratz's message of "Mon, 25 Feb 2013 12:48:08 +0000 (UTC)")



 Achim> D M German <dmg <at> uvic.ca> writes:
 >> I think the issue is that, at least in my computer the variable $\
 >> returns empty (the record separator).

 Achim> Thinko on my side, what I wanted was the input record separator "$/"
 Achim> (to avoid
 Achim> specifying a literal newline for those systems where this is actually
 Achim> multi-character).

Hi Achim,

Once I changed it:

(defvar org-babel-perl-wrapper-method
  "{
  my @r = eval( q(
%s
              ));
  open my $BO, qq(>%s) or die qq( Perl: Could not open output file.$\\ );
  print $BO join($/, @r), $/ ;
}")

the result now has \n in between fields (literally):

#+name: t_output_table
#+begin_src perl :results table
print "Test\n";
(1, 2)
#+end_src

#+RESULTS: t_output_table
| 1\n2\n |

what is the expected field separator for Org-babel?

 Achim> Regards,
 Achim> Achim.




--
Daniel M. German                  "Prose is intrinsically linear; 
                                   a good book carries the reader forward
   The Economist ->                on the crest of the words"
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .

 

  reply	other threads:[~2013-02-25 21:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-24  9:16 bug in expansion of variables in babel Perl D M German
2013-02-24  9:45 ` dmg
2013-02-24 10:23   ` D M German
2013-02-24 13:08     ` Achim Gratz
2013-02-24 18:20       ` D M German
2013-02-24 12:17 ` Achim Gratz
2013-02-24 16:52   ` Eric Schulte
2013-02-24 17:15     ` Achim Gratz
2013-02-24 18:03     ` Achim Gratz
2013-02-25  9:44       ` D M German
2013-02-24 17:05 ` [PATCH] " Achim Gratz
2013-02-25  9:42   ` D M German
2013-02-25 12:48     ` Achim Gratz
2013-02-25 21:54       ` D M German [this message]
2013-02-26 11:13         ` Achim Gratz
2013-03-02 22:01   ` Achim Gratz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bob8rrdu.fsf@mn.cs.uvic.ca \
    --to=dmg@uvic.ca \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).