X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=lib%2FOnis%2FData%2FPersistent.pm;h=8c08f28b65609e6cee633c2f79c61750e117311a;hb=f980a0f03f3f7727a602b94251f8d6d1e3a15178;hp=77935940d2a5560d5cf23a8a599a3e9e37e06aaf;hpb=1dba71b203ceb19823a3c426e303969070db42d0;p=onis.git diff --git a/lib/Onis/Data/Persistent.pm b/lib/Onis/Data/Persistent.pm index 7793594..8c08f28 100644 --- a/lib/Onis/Data/Persistent.pm +++ b/lib/Onis/Data/Persistent.pm @@ -18,9 +18,6 @@ internal data for longer than one run.. use Onis::Config qw#get_config get_checksum#; -@Onis::Data::Persistent::EXPORT_OK = qw##; -@Onis::Data::Persistent::ISA = ('Exporter'); - our $StoreModule = 'None'; =head1 CONFIGURATION OPTIONS @@ -59,12 +56,15 @@ if (get_config ('storage_module')) if ($@) { print STDERR $/, __FILE__, ": Could not load storage module ``$StoreModule''. Are you sure it exists?"; + print STDERR $/, __FILE__, ": Error while loading was: $@"; exit (1); } unshift (@Onis::Data::Persistent::ISA, $mod_name); } +return (1); + =head1 INTERFACE The child-modules have to provide the following interface: @@ -81,24 +81,24 @@ world - a table. The name must be unique for each calling method's namespace. Since this is a constructor it returns an object. The object "knows" the folling methods: -=item B<$data-Eput> (I<$name>, I<$key>, I<@fields>) +=item B<$data-Eget> (I<$key>) + +Returns the data associated with the given I<$key> pair or an empty list if no +data has been stored under this tupel before.. + +=item B<$data-Eput> (I<$key>, I<@fields>) Stores the given values in the data structure. How this is done is described below in L. Doesn't return anything. The number of entries in I<@fields> has to match the number of entries in I<@field_names> when creating the object using B. -=item B<$data-Eget> (I<$name>, I<$key>) +=item B<$data-Ekeys> ([I<$field>, ...]) -Returns the data associated with the given I<$name>/I<$key> pair or an empty -list if no data has been stored under this tupel before.. - -=item B<$data-Ekeys> (I<$name>, [I<$field>, ...]) - -Returns a list of all the keys defined for this name. If one field is given the -list will be sorted by that field's values, if more fields are given the list -is sorted with the first field taking precedence over the others. If no field -is supplied the order is undefined. +Returns a list of all the keys defined for this object. If one field is given +the list will be sorted by that field's values, if more fields are given the +list is sorted with the first field taking precedence over the others. If no +field is supplied the order is undefined. =back @@ -135,5 +135,3 @@ Florian octo Forster, L. Any comments welcome as long as I haven't started implementing this ;) =cut - -exit (0);