emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Small tutorial on how to use Perl within org


From: Achim Gratz
Subject: Re: [O] Small tutorial on how to use Perl within org
Date: Sat, 09 Mar 2013 15:24:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.93 (gnu/linux)

D M German writes:
> http://turingmachine.org/~dmg/emacs/examplePerl.org

Nice, would you consider contributing it to Worg?  I'd like to ask you
to update your Org and that description to the extra features I've
recently implemented for Perl.

--8<---------------cut here---------------start------------->8---
#+name: eg
| col1 | col2 |
|------+------|
| a    | c    |
| b    | d    |

#+name: hello
#+header: :var x = eg
#+header: :results output
#+BEGIN_SRC perl
  print qq(Hi Mom!$/I'm home.)
#+END_SRC

#+RESULTS: hello
: Hi Mom!
: I'm home.

#+name: table-passthrough
#+header: :colnames nil
#+header: :var x = eg
#+begin_src perl
 # Look Ma, no code!
#+end_src

#+RESULTS: table-passthrough
| col1 | col2 |
|------+------|
| a    | c    |
| b    | d    |

#+name: number-tablerows
#+header: :colnames no
#+header: :var x = eg
#+begin_src perl
my $i = 0;
foreach my $row (@$x) {
  unshift $row, $i++;
}
$x;
#+end_src

#+RESULTS: number-tablerows
| 0 | col1 | col2 |
| 1 | a    | c    |
| 2 | b    | d    |
--8<---------------cut here---------------end--------------->8---



Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf microQ V2.22R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




reply via email to

[Prev in Thread] Current Thread [Next in Thread]