Help for this page

Select Code to Download


  1. or download this
    $ perl -MText::Levenshtein=distance -e'print distance( "foo bar baz","
    +fooo bar baz"),$/'
    1
    $
    
  2. or download this
    use Text::Levenshtein qw/distance/;
    sub off_by_one {
        1 == distance("foo bar baz", shift);
    }