43 open(DICT, "+>dict-$$") or die "Can't create dict-$$: $!";
44 binmode DICT; # To make length expected one.
47 my $pos = look *DICT, "abash";
48 chomp($word = <DICT>);
49 print "not " if $pos < 0 || $word ne "abash";
52 $pos = look *DICT, "foo";
53 chomp($word = <DICT>);
55 print "not " if $pos != length($DICT); # will search to end of file
58 $pos = look *DICT, "aarhus", 1, 1;
59 chomp($word = <DICT>);
61 print "not " if $pos < 0 || $word ne "Aarhus";
64 close DICT or die "cannot close";