summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/lib/Search
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-11-30 08:00:32 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-11-30 08:00:32 +0000
commit3d06de7fcff1d605886d3c63220956f7260ddb84 (patch)
treeda5aa4b971926e3ef1f9263bbdeb714053206d02 /gnu/usr.bin/perl/lib/Search
parentc54c74271308a8fd18f1bc3a193343d079ebe481 (diff)
perl 5.004_04
Diffstat (limited to 'gnu/usr.bin/perl/lib/Search')
-rw-r--r--gnu/usr.bin/perl/lib/Search/Dict.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/gnu/usr.bin/perl/lib/Search/Dict.pm b/gnu/usr.bin/perl/lib/Search/Dict.pm
index 295da6b31d2..9a229a7bc02 100644
--- a/gnu/usr.bin/perl/lib/Search/Dict.pm
+++ b/gnu/usr.bin/perl/lib/Search/Dict.pm
@@ -37,7 +37,7 @@ sub look {
my($size, $blksize) = @stat[7,11];
$blksize ||= 8192;
$key =~ s/[^\w\s]//g if $dict;
- $key =~ tr/A-Z/a-z/ if $fold;
+ $key = lc $key if $fold;
my($min, $max, $mid) = (0, int($size / $blksize));
while ($max - $min > 1) {
$mid = int(($max + $min) / 2);
@@ -47,7 +47,7 @@ sub look {
$_ = <FH>;
chop;
s/[^\w\s]//g if $dict;
- tr/A-Z/a-z/ if $fold;
+ $_ = lc $_ if $fold;
if (defined($_) && $_ lt $key) {
$min = $mid;
}
@@ -61,11 +61,11 @@ sub look {
<FH> if $min;
for (;;) {
$min = tell(FH);
- $_ = <FH>
+ defined($_ = <FH>)
or last;
chop;
s/[^\w\s]//g if $dict;
- y/A-Z/a-z/ if $fold;
+ $_ = lc $_ if $fold;
last if $_ ge $key;
}
seek(FH,$min,0);