7 |
use Getopt::Long; |
use Getopt::Long; |
8 |
use neb; |
use neb; |
9 |
|
|
10 |
|
BEGIN { our $DEBUG = 0; } |
11 |
#BEGIN { $SIG{'__WARN__'} = sub { cluck @_; } } |
#BEGIN { $SIG{'__WARN__'} = sub { cluck @_; } } |
12 |
|
|
13 |
my $exec = 1; |
my $exec = 1; |
14 |
my $tree = 0; |
my $tree = 0; |
15 |
|
my $code = 0; |
16 |
|
our $DEBUG = 0; |
17 |
GetOptions('exec!' => \$exec, |
GetOptions('exec!' => \$exec, |
18 |
'E' => sub { $exec = 0 }, |
'E' => sub { $exec = 0; $code = 1 }, |
19 |
'tree' => \$tree |
'tree' => \$tree, |
20 |
|
'code' => \$code, |
21 |
|
'debug+' => \$DEBUG, |
22 |
); |
); |
23 |
|
|
24 |
foreach my $file (@ARGV) |
foreach my $file (@ARGV) |
29 |
{ |
{ |
30 |
print $neb->canonical; |
print $neb->canonical; |
31 |
} |
} |
32 |
elsif ($exec) |
|
33 |
|
if ($DEBUG >= 3) |
34 |
|
{ |
35 |
|
$Data::Dumper::Indent = 1; |
36 |
|
print Dumper $neb; |
37 |
|
print "="x70, "\n"; |
38 |
|
} |
39 |
|
|
40 |
|
if ($DEBUG >= 2) |
41 |
|
{ |
42 |
|
print $neb->code; |
43 |
|
print "="x70, "\n"; |
44 |
|
} |
45 |
|
|
46 |
|
if ($exec) |
47 |
{ |
{ |
48 |
$neb->execute; |
$neb->execute; |
49 |
} |
} |
50 |
else |
|
51 |
|
if ($code) |
52 |
{ |
{ |
53 |
print $neb->code; |
print $neb->code; |
54 |
} |
} |