stas 01/10/25 04:32:42
Modified: src/api/mod_perl-2.0/APR Table.pod
Log:
- do() method documentation
Submitted by: gozer
Revision Changes Path
1.3 +22 -2 modperl-docs/src/api/mod_perl-2.0/APR/Table.pod
Index: Table.pod
===================================================================
RCS file: /home/cvs/modperl-docs/src/api/mod_perl-2.0/APR/Table.pod,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Table.pod 2001/10/22 15:47:17 1.2
+++ Table.pod 2001/10/25 11:32:42 1.3
@@ -22,6 +22,8 @@
overlap($table_a, $table_b, $flags);
$new_table = overlay($table_base, $table_overlay, $pool);
+ $table->do(sub {print "key $_[0], value $_[1]\n"}, @valid_keys);
+
#Tied Interface
$value = $table->{$key};
$table->{$key} = $value;
@@ -143,9 +145,24 @@
param C<$val>: The value to add.
=item * do()
+
+ $table->do(sub {[...]}, [EMAIL PROTECTED]);
+
+Iterate over all the elements of the table, invoking provided
+subroutine for each element. The subroutine gets passed as argument,
+a key-value pair.
+
+The subroutine can abort the iteration by returning 0 and should
+always return 1 otherwise.
- META: ???
+param C<sub>: A subroutine reference or name to be called on each item
+in the table
+param C<@filter>: Only keys matching one of the entries in the filter
+will be processed
+
+
+
=item * get()
$val = $table->get($key);
@@ -245,7 +262,10 @@
the same key, so when using a table through the tied interface, the
first entry found with the right key will be used, completely
disregarding possible other entries with the same key. The only
-exception to this is if you iterate over the list with I<each>.
+exception to this is if you iterate over the list with I<each>, then
+you can access all key-value pairs that share the same key.
+
+
=cut
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]