]> git.p6c8.net - selfforum.git/blobdiff - selfforum-cgi/shared/Id.pm
modified version check
[selfforum.git] / selfforum-cgi / shared / Id.pm
index 22535a20bc4ff605b8160d36f4aee3eff5320f39..4d0914332a6a106a9f95e2611d6daf7da44be668 100644 (file)
@@ -4,7 +4,7 @@ package Id;
 #                                                                              #
 # File:        shared/Id.pm                                                    #
 #                                                                              #
-# Authors:     AndrĂ© Malo <nd@o3media.de>, 2001-05-03                          #
+# Authors:     AndrĂ© Malo <nd@o3media.de>                                      #
 #                                                                              #
 # Description: compose an unique ID (in CGI context)                           #
 #                                                                              #
@@ -14,14 +14,17 @@ use strict;
 use vars qw(
   @table
   @EXPORT
-  $VERSION
 );
 
 ################################################################################
 #
 # Version check
 #
-$VERSION = do { my @r =(q$Revision$ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+# last modified:
+#    $Date$ (GMT)
+# by $Author$
+#
+sub VERSION {(q$Revision$ =~ /([\d.]+)\s*$/)[0] or '0.0'}
 
 ################################################################################
 #
@@ -66,6 +69,8 @@ sub unique_id () {
 #
 sub to_base64 ($) {
   my $x = shift;
+  return '' unless defined $x;
+
   my $y = $table[$x % 64];
 
   $y = $table[$x % 64].$y while ($x = int ($x/64));

patrick-canterino.de