|
SDF::Sort::Random - Sort an PTools::SDF::SDF object in random order |
SDF::Sort::Random - Sort an PTools::SDF::SDF object in random order
This document describes version 0.01, released March, 2005.
use PTools::SDF::SDF; # or any subclass thereof, including:
use PTools::SDF::ARRAY;
use PTools::SDF::IDX;
use PTools::SDF::DIR;
use PTools::SDF::DSET;
$sdfObj = new PTools::SDF::SDF( $fileName );
$sdfObj->extend( "sort", "PTools::SDF::Sort::Random" );
$sdfObj->sort();
($stat,$err) = $sdfObj->status;
$stat and die $err;
This sort class is one of several extended classes used to select which algorithm is employed to sort data in the calling object. It is up to the client script to select the specific algorithm, as shown in the Synopsis section, above.
This class is used to sort the data in random order.
The interface of this sort method is documented here. This is the intended usage for clients of the PTools::SDF::* class of objects.
The actual calling syntax for module designers is shown in the following section, below.
No arguments are needed, and the resulting ordering will be random.
At least two records must exist in the containing PTools::SDF::SDF object or an exception is generated.
Example:
use PTools::SDF::SDF;
$sdfObj = new PTools::SDF::SDF( "/etc/passwd" );
$sdfObj->extend( "sort", "PTools::SDF::Sort::Random" );
$sdfObj->sort();
($stat,$err) = $sdfObj->status;
$stat and die $err;
Of course, this just an example. It might seem strange to sort the system password file in a random order.
The actual calling syntax for module designers is documented here. This is the syntax used when invoking this method from withn the extended sort method of the PTools::SDF::SDF class only.
The user interface of this sort method is shown in the preceeding section.
No other parameters are necessary when using this class.
None currently.
Other extended sort classes are available. See the PTools::SDF::Sort::Bubble manpage, the PTools::SDF::Sort::Quick manpage and the PTools::SDF::Sort::Shell manpage.
Also see the PTools::SDF::Overview manpage, the PTools::SDF::ARRAY manpage, the PTools::SDF::CSV manpage, the PTools::SDF::DB manpage, the PTools::SDF::DIR manpage, the PTools::SDF::DSET manpage, the PTools::SDF::File manpage, the PTools::SDF::IDX manpage, the PTools::SDF::INI manpage, the PTools::SDF::SDF manpage, the PTools::SDF::TAG manpage and the PTools::SDF::Lock::Advisory manpage.
Chris Cobb, <nospamplease@ccobb.net>
Copyright (c) 2005-2007 by Chris Cobb. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|
SDF::Sort::Random - Sort an PTools::SDF::SDF object in random order |