summaryrefslogtreecommitdiff
path: root/fml/lib/IO/Adapter/File.pm
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-08-19 15:19:46 +0000
committerfukachan <fukachan>2002-08-19 15:19:46 +0000
commit2c1dd968f3e38412aa551cfb9fe10f09d8907097 (patch)
tree41c8d23c5c0c4ca054ec9eb2956b7021b23be5c2 /fml/lib/IO/Adapter/File.pm
parent92da0e92782a102adeb37c9fb13867ce17a16214 (diff)
downloadfml8-2c1dd968f3e38412aa551cfb9fe10f09d8907097.tar.gz
fml8-2c1dd968f3e38412aa551cfb9fe10f09d8907097.tar.bz2
fml8-2c1dd968f3e38412aa551cfb9fe10f09d8907097.zip
delete(KEY) not (REGEXP)
Diffstat (limited to 'fml/lib/IO/Adapter/File.pm')
-rw-r--r--fml/lib/IO/Adapter/File.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/fml/lib/IO/Adapter/File.pm b/fml/lib/IO/Adapter/File.pm
index 1e364073..33c33f91 100644
--- a/fml/lib/IO/Adapter/File.pm
+++ b/fml/lib/IO/Adapter/File.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: File.pm,v 1.36 2002/07/25 11:34:02 fukachan Exp $
+# $FML: File.pm,v 1.37 2002/08/19 15:06:35 fukachan Exp $
#
package IO::Adapter::File;
@@ -377,20 +377,20 @@ sub add
}
-=head2 C<delete($regexp)>
+=head2 C<delete($key)>
-delete lines which matches $regexp from this map.
+delete lines with key $key from this map.
=cut
# Descriptions: delete address(es) matching $reexp from map
-# Arguments: OBJ($self) STR($regexp)
+# Arguments: OBJ($self) STR($key)
# Side Effects: update map
# Return Value: same as close()
sub delete
{
- my ($self, $regexp) = @_;
+ my ($self, $key) = @_;
$self->open("w");
@@ -400,7 +400,7 @@ sub delete
if (defined $fh) {
FILE_IO:
while (<$fh>) {
- next FILE_IO if /$regexp/;
+ next FILE_IO if /^$key\s+\S+|^$key\s*$/;
print $wh $_;
}
$fh->close;