* Add enclair_db option to UserDB.pm. Allows logging of enclair password
[interchange.git] / code / UserTag / rand.tag
1 # Copyright 2002-2007 Interchange Development Group and others
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.  See the LICENSE file for details.
7
8 # $Id: rand.tag,v 1.5 2007-03-30 23:40:57 pajamian Exp $
9
10 UserTag rand Order     file
11 UserTag rand posNumber 1
12 UserTag rand addAttr
13 UserTag rand hasEndTag
14 UserTag rand Version   $Revision: 1.5 $
15 UserTag rand Routine   <<EOR
16 sub {
17         my ($file, $opt, $inline) = @_;
18         my $sep = $opt->{separator} || '\[alt\]';
19         $inline = ::readfile($file)
20                 if $file;
21         my @pieces = split /$sep/, $inline;
22         return $pieces[int(rand(scalar @pieces))] ;
23 }
24 EOR