Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
SPOPS::Key::Random(3) User Contributed Perl DocumentationSPOPS::Key::Random(3)

NAME
       SPOPS::Key::Random - Creates a random alphanumeric code for the ID
       field

SYNOPSIS
	# In your SPOPS	configuration

	$spops	= {
	  'myspops' => {
	      'isa'	 => [ qw/ SPOPS::Key::Random  SPOPS::DBI / ],
	      'id_width' => 12,
	      ...
	  },
	};

DESCRIPTION
       Very, very simple. We just use the generate_random_code() method	from
       SPOPS::Utility to generate an n character code. The width of the	code
       is determined by	the configuration key "id_width" in your object	class,
       or we use a default width (eight	characters).

BUGS
       Getting a 'random' value

       If you are using	this under mod_perl, you might have the	problem	of
       colliding ID fields. This seems to happen because the httpd children
       all have	the same random	seed, since they are all forked	off from the
       same parent.

       The solution is to put a	'srand()' in the PerlChildInitHandler,
       although	mod_perl versions greater than 1.25 are	reported to take care
       of this for you.

TO DO
       Nothing known.

COPYRIGHT
       Copyright (c) 2001-2004 intes.net, inc..	All rights reserved.

       This library is free software; you can redistribute it and/or modify it
       under the same terms as Perl itself.

AUTHORS
       Chris Winters  <chris@cwinters.com>

perl v5.32.0			  2004-06-02		 SPOPS::Key::Random(3)

NAME | SYNOPSIS | DESCRIPTION | BUGS | TO DO | COPYRIGHT | AUTHORS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=SPOPS::Key::Random&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help