in reply to Re: Regexp::Approx - Use fuzzy regular expressions
in thread Regexp::Approx - Use fuzzy regular expressions

Drat. I musta screwed up the failure case while working on the send/recv functions. It did work correctly before. Fixes to come in an hour or so.

Got it. The code was testing the return value of print() instead of the actual match response. When I added the general function wrapper I forgot to put a `return _read_msg()` in. (Again) it works correctly for me using your sample script.

  • Comment on Re: Re: Regexp::Approx - Use fuzzy regular expressions

Replies are listed 'Best First'.
Re: Re: Re: Regexp::Approx - Use fuzzy regular expressions
by Anonymous Monk on Nov 12, 2003 at 15:36 UTC

    There seems to be remaining problems, for example:

    #!/usr/bin/perl -w use strict; use lib '.'; use Regexp::Approx 'fuzzy_qr'; use re 'eval'; while(<DATA>) { chomp; print "Using '$_' as fuzzy component:\n"; my $fuzzy_part = fuzzy_qr( $_ ); my $rx = qr/($fuzzy_part)/; if ( "5678 DELAWARE AVENUE AOT 123" =~ /$rx/ ) { print "\tRX Match: $1\n"; } } __END__ APT A XXX ^%@#!( fuzzy matches anything? x #### output: Using 'APT' as fuzzy component: RX Match: AO Using 'A' as fuzzy component: RX Match: 5 Using 'XXX' as fuzzy component: amatch: $_ is undefined: what are you matching? Compilation failed in require at xxx.pl line 4, <GEN0> line 51. BEGIN failed--compilation aborted at xxx.pl line 4, <GEN0> line 51. Using '^%@#!(' as fuzzy component: Broken pipe ### platform: $ perl -v This is perl, v5.8.0 built for i686-linux