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

SF.net SVN: ledger-smb: [446] trunk/utils/cli/ledgersmb_cli.pl



Revision: 446
          http://svn.sourceforge.net/ledger-smb/?rev=446&view=rev
Author:   einhverfr
Date:     2006-10-31 21:05:19 -0800 (Tue, 31 Oct 2006)

Log Message:
-----------
More on the cli script wrapper

Modified Paths:
--------------
    trunk/utils/cli/ledgersmb_cli.pl

Modified: trunk/utils/cli/ledgersmb_cli.pl
===================================================================
--- trunk/utils/cli/ledgersmb_cli.pl	2006-11-01 04:49:28 UTC (rev 445)
+++ trunk/utils/cli/ledgersmb_cli.pl	2006-11-01 05:05:19 UTC (rev 446)
@@ -10,12 +10,24 @@
 $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";
+}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.