From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?=C5=81ukasz?= Stelmach Subject: Re: [BUG] org-babel-perl and formats Date: Fri, 09 Apr 2010 11:11:33 +0200 Message-ID: <87r5mpyoqi.fsf@dasa3.iem.pw.edu.pl> References: <874ojm7py8.fsf@kotik.lan> <8739z6djv5.fsf@stats.ox.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O0AFj-0005ye-SK for emacs-orgmode@gnu.org; Fri, 09 Apr 2010 05:11:51 -0400 Received: from [140.186.70.92] (port=52504 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0AFi-0005yR-5h for emacs-orgmode@gnu.org; Fri, 09 Apr 2010 05:11:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O0AFf-0007B1-V7 for emacs-orgmode@gnu.org; Fri, 09 Apr 2010 05:11:50 -0400 Received: from lo.gmane.org ([80.91.229.12]:55468) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0AFf-0007Ap-I3 for emacs-orgmode@gnu.org; Fri, 09 Apr 2010 05:11:47 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1O0AFb-0003Zs-0n for emacs-orgmode@gnu.org; Fri, 09 Apr 2010 11:11:43 +0200 Received: from dasa3.iem.pw.edu.pl ([194.29.147.110]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Apr 2010 11:11:43 +0200 Received: from lukasz.stelmach by dasa3.iem.pw.edu.pl with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Apr 2010 11:11:43 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Dan Davison writes: > Łukasz Stelmach writes: >> I am not sure I will be able to spend some time on this so I'll share my >> observation with you. org-babel-perl can't cope with perl formats, with >> their endings to be precise. A format is defined by: >> >> format FORMAT_NAME = >> body of the format >> . >> >> The problem is that formats *must* and with a single solitary dot or, to >> be precise "\n.\n" sequence. org-babel-perl doesn't care about it and >> puts "\t" befor the dot. > > Could you post an example? I don't believe we insert tab > characters. I've never used a perl format before, but I just tried it > and it seemed to work OK with C-c C-c: > > #+begin_src perl > format STDOUT = > @<<<<<< @|||||| @>>>>>> > "left", "middle", "right" > . > write ; > #+end_src > > #+results: > : left middle right With the very same code i get --8<---------------cut here---------------start------------->8--- Format not terminated at - line 11, at end of line syntax error at - line 11, at EOF Execution of - aborted due to compilation errors. --8<---------------cut here---------------end--------------->8--- while strace shows the code being wrapped write(9, "\nsub main {\n\tformat STDOUT =\n\t@<<<<<< @|||||| @>>>>>>\n\t\"left\", \"middle\", \"right\"\n\t.\n\twrite ;\n}\n@r = main;\nopen(o, \">/tmp/perl-functional-results17170oCG\");\nprint o join(\"\\n\", @r), \"\\n\"", 184) = 184 inside something really odd: --8<---------------cut here---------------start------------->8--- sub main { format STDOUT = @<<<<<< @|||||| @>>>>>> "left", "middle", "right" . write ; } @r = main; open(o, ">/tmp/perl-functional-results17170oCG"); print o join("\n", @r), "\n" --8<---------------cut here---------------end--------------->8--- > Incidentally, do you know the variable org-src-preserve-indentation? > When I first read your email I thought that would be the answer. In fact > it doesn't seem to be relevant, but I thought I would mention it anyway. Unfortunately it doesn't make any difference. -- Miłego dnia, Łukasz Stelmach