summaryrefslogtreecommitdiff
path: root/utils/cli/ledgersmb_cli.pl
blob: 72e4e2f7a27cf44140bd9357f404fb760602caab (plain)
  1. #!/usr/bin/perl
  2. # This is a simple wrapper that allows you to write simple scripts with LSMB
  3. # See sample for the file format.
  4. use LedgerSMB::User;
  5. use LedgerSMB::Form;
  6. use LedgerSMB::Sysconfig;
  7. $form = new Form;
  8. while ($line = <>){
  9. if ($line =~ /^\s*CALL (.+) INTO (.+)/){
  10. $form->{$2} = %${$1};
  11. } elsif ($line =~ /^\s*MODULE (.+)/){
  12. } elsif ($line =~ /^\s*ENV:(.+)\s*=\s*(.*)/){
  13. } elsif ($line =~ /^\s*(.+)\s*=\s*(.+)/){
  14. } else {
  15. die "Parse error in script file: $line";
  16. }
  17. }