From ebfe131226689bf1ab87f7d09dae111104ac2eb3 Mon Sep 17 00:00:00 2001 From: fukachan Date: Sun, 11 Mar 2001 12:02:35 +0000 Subject: replace() method and the checker --- fml/lib/IO/MapAdapter.pm | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'fml/lib/IO/MapAdapter.pm') diff --git a/fml/lib/IO/MapAdapter.pm b/fml/lib/IO/MapAdapter.pm index 7541a247..d4a690dd 100644 --- a/fml/lib/IO/MapAdapter.pm +++ b/fml/lib/IO/MapAdapter.pm @@ -230,6 +230,10 @@ add $address to the specified map. delete lines which matches $regexp from this map. +=head2 C + +replace lines which matches $regexp with $value. + =cut @@ -257,10 +261,10 @@ sub add # Return Value: none sub delete { - my ($self, $address) = @_; + my ($self, $regexp) = @_; if ($self->can('delete')) { - $self->SUPER::delete($address); + $self->SUPER::delete($regexp); } else { $self->_error_reason("Error: delete() method is not supported."); @@ -269,6 +273,24 @@ sub delete } +# Descriptions: +# Arguments: $self $regexp $value +# Side Effects: +# Return Value: none +sub replace +{ + my ($self, $regexp, $value) = @_; + + if ($self->can('replace')) { + $self->SUPER::replace($regexp, $value); + } + else { + $self->_error_reason("Error: replace() method is not supported."); + undef; + } +} + + # Descriptions: destructor # request is forwarded to close() method. # Arguments: $self $args -- cgit v1.2.1