Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

data::random::wordlist(3pm) [debian man page]

Data::Random::WordList(3pm)				User Contributed Perl Documentation			       Data::Random::WordList(3pm)

NAME
Data::Random::WordList - Perl module to get random words from a word list SYNOPSIS
use Data::Random::WordList; my $wl = new Data::Random::WordList( wordlist => '/usr/share/dict/words' ); my @rand_words = $wl->get_words(10); $wl->close(); DESCRIPTION
Data::Random::WordList is a module that manages a file containing a list of words. The module expects each line of the word list file to contain only one word. It could thus be easily used to select random lines from a file, but for coherency's sake, I'll keep referring to each line as a word. The module uses a persistent filehandle so that there isn't a lot of overhead every time you want to fetch a list of random words. However, it's much more efficient to grab multiple words at a time than it is to fetch one word at a time multiple times. The module also refrains from reading the whole file into memory, so it can be safer to use with larger files. METHODS
new() Returns a reference to a new Data::Random::WordList object. Use the "wordlist" param to initialize the object: o wordlist - the path to the wordlist file. If a path isn't supplied, the wordlist distributed with this module is used. get_words([NUM]) NUM contains the number of words you want from the wordlist. NUM defaults to 1 if it's not specified. get_words() dies if NUM is greater than the number of words in the wordlist. This function returns an array or an array reference depending on the context in which it's called. close() Closes the filehandle associated with the word list. It's good practice to do this every time you're done with the word list. VERSION
0.07 AUTHOR
Originally written by: Adekunle Olonoh Currently maintained by: Buddy Burden (barefoot@cpan.org), starting with version 0.06 COPYRIGHT
Copyright (c) 2000-2011 Adekunle Olonoh. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Data::Random perl v5.14.2 2012-06-04 Data::Random::WordList(3pm)

Check Out this Related Man Page

WWW::Mechanize::FormFiller::Value::Random(3pm)		User Contributed Perl Documentation	    WWW::Mechanize::FormFiller::Value::Random(3pm)

NAME
WWW::Mechanize::FormFiller::Value::Random - Randomly fill out a HTML form field SYNOPSIS
use WWW::Mechanize::FormFiller; use WWW::Mechanize::FormFiller::Value::Random; my $f = WWW::Mechanize::FormFiller->new(); # Create a random value for the HTML field "login" my $login = WWW::Mechanize::FormFiller::Value::Random->new( login => "root","administrator","corion" ); $f->add_value( login => $login ); # Alternatively take the following shorthand, which adds the # field to the list as well : # If there is no password, put a random one out of the list there my $password = $f->add_filler( password => Random => "foo","bar","baz" ); DESCRIPTION
This class provides a way to write a randomly chosen value into a HTML field. new NAME, LIST Creates a new value which will correspond to the HTML field "NAME". The "LIST" is a list of items one of which will be returned for each call to "value()". There is no persistence of these values. For items that can only take a finite set of elements, a random element out of that list is taken by default. name [NEWNAME] Gets and sets the name of the HTML field this value corresponds to. value FIELD Returns the value to put into the HTML field. EXPORT None by default. COPYRIGHT AND LICENSE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Copyright (C) 2002,2003 Max Maischein AUTHOR
Max Maischein, <corion@cpan.org> Please contact me if you find bugs or otherwise improve the module. More tests are also very welcome ! SEE ALSO
WWW::Mechanize, WWW::Mechanize::Shell, WWW::Mechanize::FormFiller, WWW::Mechanize::FormFiller::Value::Value, WWW::Mechanize::FormFiller::Value::Default, WWW::Mechanize::FormFiller::Value::Fixed, WWW::Mechanize::FormFiller::Value::Interactive perl v5.10.1 2009-04-24 WWW::Mechanize::FormFiller::Value::Random(3pm)
Man Page