diff options
| author | fukachan <fukachan> | 2001-03-11 12:02:35 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-03-11 12:02:35 +0000 |
| commit | ebfe131226689bf1ab87f7d09dae111104ac2eb3 (patch) | |
| tree | bf8f1c7d989cdcb53b943f5d319b9b1e6be52760 /fml/lib/IO/MapAdapter.pm | |
| parent | c8785198f4d27a3f83ba1c5c2cbcdcfe9c4e33bc (diff) | |
| download | fml8-ebfe131226689bf1ab87f7d09dae111104ac2eb3.tar.gz fml8-ebfe131226689bf1ab87f7d09dae111104ac2eb3.tar.bz2 fml8-ebfe131226689bf1ab87f7d09dae111104ac2eb3.zip | |
replace() method and the checker
Diffstat (limited to 'fml/lib/IO/MapAdapter.pm')
| -rw-r--r-- | fml/lib/IO/MapAdapter.pm | 26 |
1 files changed, 24 insertions, 2 deletions
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<regexp( $regexp, $value )> + +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 |
