summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils/cli/ledgersmb_cli.pl16
1 files changed, 14 insertions, 2 deletions
diff --git a/utils/cli/ledgersmb_cli.pl b/utils/cli/ledgersmb_cli.pl
index 72e4e2f7..1dbbf2fa 100644
--- a/utils/cli/ledgersmb_cli.pl
+++ b/utils/cli/ledgersmb_cli.pl
@@ -10,12 +10,24 @@ use LedgerSMB::Sysconfig;
$form = new Form;
while ($line = <>){
+ $line =~ s/#.*//; # strip out comments
if ($line =~ /^\s*CALL (.+) INTO (.+)/){
- $form->{$2} = %${$1};
+ $form->{$2} = &{$1}(\%$form);
} elsif ($line =~ /^\s*MODULE (.+)/){
+ $module = $1;
+ $module =~ s/::/\//;
+ eval { require $module; };
} elsif ($line =~ /^\s*ENV:(.+)\s*=\s*(.*)/){
+ $ENV{$1} = $2;
} elsif ($line =~ /^\s*(.+)\s*=\s*(.+)/){
- } else {
+ $form->{$1} = $2;
+ } elsif ($line =~ /^\s*CALL (.+)/){
+ &{$1}(\%$form);
+ } elsif ($line !~ /^\s*$/) {
die "Parse error in script file: $line";
}
}
+
+for (keys %$form){
+ print "$_ = $form->{$_}\n";
+}