--- nfo/perl/scripts/shortcuts/rap.pl 2003/02/20 21:39:49 1.3 +++ nfo/perl/scripts/shortcuts/rap.pl 2003/03/29 06:54:59 1.5 @@ -1,9 +1,15 @@ #!/usr/bin/perl ## ------------------------------------------------------------------------- -## $Id: rap.pl,v 1.3 2003/02/20 21:39:49 joko Exp $ +## $Id: rap.pl,v 1.5 2003/03/29 06:54:59 joko Exp $ ## ------------------------------------------------------------------------- ## $Log: rap.pl,v $ +## Revision 1.5 2003/03/29 06:54:59 joko +## + sub rap_boot +## +## Revision 1.4 2003/03/27 15:58:08 joko +## enhancement: now can execute perl-programs via 'do' here +## ## Revision 1.3 2003/02/20 21:39:49 joko ## - find_rules moved to Rap.pm ## @@ -61,9 +67,25 @@ sub main { my $argString = shift; - my $rap = Data::Rap->new( target => $argString ); - $rap->start(); - #$rap->stop(); + + # check if target is a namespace-string (contains '::') + # TODO: move this logic/code to inside Data::Rap! + if ($argString =~ s/::/\//g) { + my $res = do "$argString"; + print $res, "\n" if $res; + } else { + my $rap = Data::Rap->new( target => $argString ); + rap_boot(); + $rap->start(); + #$rap->stop(); + } +} + +sub rap_boot { + # check for another environment-variable: 'RAPBIN' + # FIXME: what about 'topic.basedir'??? implement this here! + # enhance infrastructure to have per-topic basedirs!!! + chdir $ENV{RAPBIN} if $ENV{RAPBIN}; } my @args = @ARGV;