--- nfo/perl/scripts/shortcuts/rap.pl 2003/02/20 21:39:49 1.3 +++ nfo/perl/scripts/shortcuts/rap.pl 2003/03/27 15:58:08 1.4 @@ -1,9 +1,12 @@ #!/usr/bin/perl ## ------------------------------------------------------------------------- -## $Id: rap.pl,v 1.3 2003/02/20 21:39:49 joko Exp $ +## $Id: rap.pl,v 1.4 2003/03/27 15:58:08 joko Exp $ ## ------------------------------------------------------------------------- ## $Log: rap.pl,v $ +## 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 +64,17 @@ 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->start(); + #$rap->stop(); + } } my @args = @ARGV;