If there is a cache directory, save there all compiled code.
[artemus.git] / art5
blobbed7034884c36a1136879d1b1895ce3d75419d7a
1 #!/usr/bin/perl
3 use Art5;
5 my $dump = 0;
6 my $v, $s;
7 my @path = ();
9 # raw argument parsing
10 while ($v = shift(@ARGV)) {
11 if ($v eq '-d') {
12 $dump = 1;
14 elsif ($v eq '-I') {
15 push(@path, shift(@ARGV));
17 else {
18 # script name
22 if (!defined($s)) {
23 $s = join('', <>);
26 my $a = Art5->new( path => \@path, cache => '/tmp/art5/');
28 my $c = $a->compile($s);
30 if ($dump) {
31 use Data::Dumper;
33 print Dumper($c), "\n";
35 else {
36 print $a->exec($c);
39 exit 0;