summaryrefslogtreecommitdiff
path: root/lsmb.pl
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-04-26 18:00:56 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-04-26 18:00:56 +0000
commit666fd833584fe2e3618a397fe9d9a9bdf4c5b94b (patch)
tree19c4444705fd7f7803e0d7b597659c11d7e85b73 /lsmb.pl
parent2edd2e4de0f08a0a5f23647ea715f279671a0b89 (diff)
Doing a simple Perltidy commit so that I can evaluate differences between the branches and make sure patches are up to date
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1103 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'lsmb.pl')
-rwxr-xr-xlsmb.pl60
1 files changed, 32 insertions, 28 deletions
diff --git a/lsmb.pl b/lsmb.pl
index cdc4737c..d74f714d 100755
--- a/lsmb.pl
+++ b/lsmb.pl
@@ -10,37 +10,41 @@ use warnings;
use strict;
use CGI::Carp qw(fatalsToBrowser);
-sub cgi_handle {
- my $self = shift;
-
- my $script = $ENV{PATH_INFO};
-
- $script =~ s/^\///;
- # TODO: we can parse out other information, such as
- # Company Identifier, and what not here.
-
- #return $self->debug();
-
- if($script =~ /\.pl$/) {
- # perl scripts should be directly executed.
- warn "[LedgerSMB::Handler] running $script";
- exec("./$script") or croak $!;
- } else {
- # redirect them back to the original url
-
- # infer the base URI, this fails unless the script is named lsmb.pl
- my ($base_uri) = $ENV{SCRIPT_NAME} =~ m#^(.*?)/lsmb.pl#;
- print "Status: 301\nLocation: $base_uri/$script\n\n";
- }
+sub cgi_handle {
+ my $self = shift;
+
+ my $script = $ENV{PATH_INFO};
+
+ $script =~ s/^\///;
+
+ # TODO: we can parse out other information, such as
+ # Company Identifier, and what not here.
+
+ #return $self->debug();
+
+ if ( $script =~ /\.pl$/ ) {
+
+ # perl scripts should be directly executed.
+ warn "[LedgerSMB::Handler] running $script";
+ exec("./$script") or croak $!;
+ }
+ else {
+
+ # redirect them back to the original url
+
+ # infer the base URI, this fails unless the script is named lsmb.pl
+ my ($base_uri) = $ENV{SCRIPT_NAME} =~ m#^(.*?)/lsmb.pl#;
+ print "Status: 301\nLocation: $base_uri/$script\n\n";
+ }
}
-sub debug {
- my $self = shift;
+sub debug {
+ my $self = shift;
- use Data::Dumper;
- print "Content-type: text/plain\n\n";
- print "\$0 is $0\n";
- print Dumper(\%ENV);
+ use Data::Dumper;
+ print "Content-type: text/plain\n\n";
+ print "\$0 is $0\n";
+ print Dumper( \%ENV );
}