Hi everyone,
I'm trying to get my head around babel and getting info back into a
table.
The below org file tracks expenses and the perl code simply sums them
up.
The code is working but I now want to get the total back into another table.
What I have is not
working can someone tell me what I'm doing wrong here?
Cheers
Bart
* Expenses
#+tblname: expenses
|------------+-----------------------------------+--------|
| Date | What | Amount |
|------------+-----------------------------------+--------|
| 2010-07-26 | Breakfast | 5 |
| 2010-07-26 | groceries | 8.5 |
| 2010-07-26 | butchers - chicken | 5.5 |
| 2010-07-27 | umart - video card, kvm, speakers | 136 |
* Code
#+srcname: totals
#+begin_src perl :var details=expenses[1:-1]
my $total = 0;
foreach my $row (@$details) {
$total += @$row[2];
}
return $total;
#+end_src
#+results: totals
: 155
* Totals
| Total | #ERROR |
#+TBLFM: $2=#+call: totals(details=expenses)
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-orgmode