]> git.donarmstrong.com Git - debbugs.git/blob - Debbugs/Common.pm
[project @ 2000-04-29 10:06:31 by doogie]
[debbugs.git] / Debbugs / Common.pm
1 package Debbugs::Common; 
2
3 use strict;
4
5 BEGIN {
6         use Exporter   ();
7         use vars       qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
8
9         # set the version for version checking
10         $VERSION     = 1.00;
11
12         @ISA         = qw(Exporter);
13         @EXPORT      = qw( &fail );
14         %EXPORT_TAGS = (  );     # eg: TAG => [ qw!name1 name2! ],
15
16         # your exported package globals go here,
17         # as well as any optionally exported functions
18         @EXPORT_OK   = qw();
19 }
20
21 use vars      @EXPORT_OK;
22 use Debbugs::Config qw(%Globals);
23
24 sub fail
25 {
26         print "$_[0]\n";
27         exit 1;
28 }
29 sub NameToPathHash
30 {
31 #   12345 -> 5/4/3/12345
32 #   12 -> s/2/1/12
33     my $name = $_[0];
34     my $tmp = $name;
35     $name =~ /^.*?(.)(.)(.)$/ ;
36     if(!defined($1)) {
37         $name =~ /^(.*?)(.)(.)$/ ;
38         $tmp = "$1$2$3"."s";
39     }
40     $tmp =~ /^.*?(.)(.)(.)$/ ;
41     return "$3/$2/$1/$name";
42 }
43
44 1;
45 END { }       # module clean-up code here (global destructor)