/[cvs]/nfo/perl/scripts/shortcuts/rap.pl
ViewVC logotype

Contents of /nfo/perl/scripts/shortcuts/rap.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations)
Thu Feb 20 21:39:49 2003 UTC (21 years, 4 months ago) by joko
Branch: MAIN
Changes since 1.2: +36 -19 lines
File MIME type: text/plain
- find_rules moved to Rap.pm

1 #!/usr/bin/perl
2
3 ## -------------------------------------------------------------------------
4 ## $Id: rap.pl,v 1.2 2003/02/18 19:09:07 jonen Exp $
5 ## -------------------------------------------------------------------------
6 ## $Log: rap.pl,v $
7 ## Revision 1.2 2003/02/18 19:09:07 jonen
8 ## + cwd for linux bootstrap
9 ##
10 ## Revision 1.1 2003/02/18 15:30:52 joko
11 ## + initial commit
12 ##
13 ## -------------------------------------------------------------------------
14
15
16 use strict;
17 use warnings;
18
19
20 use File::Spec::Functions qw( splitpath splitdir catpath catdir );
21
22 sub popdir {
23 my $path = shift;
24 my $popcount = shift;
25 (my $volume, my $directory, my $file) = splitpath( $path );
26 my @dir = splitdir($directory);
27 while ($popcount--) {
28 pop @dir;
29 }
30 #pop @dir;
31
32 #my $base = catpath($volume, catdir(@dir));
33 my $base = join('/', @dir);
34 $base = $volume . $base if $volume;
35
36 return $base;
37 }
38
39
40
41 BEGIN {
42 use FindBin qw($Bin);
43 #use lib "$Bin/../../libs";
44 my $libpath = popdir($Bin, 2) . '/libs';
45 #print "libpath: $libpath", "\n";
46 #exit;
47 my $evs = "use lib '$libpath';";
48 #print "evs: $evs", "\n";
49 eval($evs);
50 die($@) if $@;
51 }
52
53
54 # ------------------------------------ main ------------
55 use Data::Dumper;
56 use Data::Rap;
57
58
59 sub main {
60 my $argString = shift;
61 my $rap = Data::Rap->new( target => $argString );
62 $rap->start();
63 #$rap->stop();
64 }
65
66 my @args = @ARGV;
67 @args = () if not @args;
68 main(join(' ', @args));
69
70
71 1;
72 __END__

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed