I have Tree:Trie created when I do a prefix search I am not getting the response I expect

here is the trie

0 Tree::Trie=HASH(0x600d98df8) '_DEEPSEARCH' => 3 '_END' => '' '_FREEZE_END' => 0 '_MAINHASHREF' => HASH(0x600d99050) '+' => HASH(0x600d9cfa8) 6 => HASH(0x600d9d0c8) 1 => HASH(0x600d9d008) '' => 'Term' 1 => HASH(0x600d9d2d8) 4 => HASH(0x600d9d188) 1 => HASH(0x600d9cea0) 1 => HASH(0x600d9d200) '' => 'Outleg_1' 0 => HASH(0x600d9d170) '' => 'Outleg_2' 5 => HASH(0x600d9d458) '' => 'Term_Ref' 'd' => HASH(0x600d9d0b0) 'e' => HASH(0x600d9d260) 'f' => HASH(0x600d98f78) 'a' => HASH(0x600d9d578) 'u' => HASH(0x600d983d8) 'l' => HASH(0x600d9d5a8) 't' => HASH(0x600d9d5d8) '' => 'Unknown'
  • do a search for +6114110
  • x $trie->lookup( "+6114110" )

    0 '+6114110'

  • do a search for +61141102
  • x $trie->lookup( "+61141102" )

    empty array

    I was expecting to get the same result, As it is the best prefix that matches

    Or I have got it wrong?


    In reply to A question a Tree::Trie by jhuijsing

    Title:
    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.