in reply to Partial extractions on hashes

Do not ++ this node - i don't need the XP :)

since davorg is a modest soul, i wanted point any person interested in this problem to his solution: Tie::Hash::Regex.

Jeff

R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
L-L--L-L--L-L--L-L--L-L--L-L--L-L--
  • Comment on (jeffa) Re: Partial extractions on hashes

Replies are listed 'Best First'.
Re: (jeffa) Re: Partial extractions on hashes
by busunsl (Vicar) on May 11, 2001 at 16:47 UTC

      Actually, I think you've got that slightly wrong. The original code says:

      if(!exists $is_acct{$usershare}){

      Which is searching on key - not value.

      Tie::Hash::Regex still isn't a solution because I only implemented the FETCH method, not EXISTS. But it wouldn't be too difficult to add that.

      --
      <http://www.dave.org.uk>

      "Perl makes the fun jobs fun
      and the boring jobs bearable" - me

        You're right, the code says
        if(!exists $is_acct{$usershare}){
        but the text says:

        "3. Then I am trying to compare all of the values in @dirs against the values in %is_acct for a partial match."

        So I think he wants to match the values in the hash and not the keys.