Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: (jeffa) Re: Partial extractions on hashes

by busunsl (Vicar)
on May 11, 2001 at 16:47 UTC ( #79690=note: print w/replies, xml ) Need Help??

in reply to (jeffa) Re: Partial extractions on hashes
in thread Partial extractions on hashes

While Tie::Hash::Regex (++) is really cool, it is no solution to this problem.
Tie::Hash::Regex matches the keys, not the values.
  • Comment on Re: (jeffa) Re: Partial extractions on hashes

Replies are listed 'Best First'.
Re: Re: (jeffa) Re: Partial extractions on hashes
by davorg (Chancellor) on May 11, 2001 at 16:55 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.


    "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.

        You're right. I was originally matching the keys, but because of the marraiges, I have to match the values.


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://79690]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2023-03-28 07:52 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (66 votes). Check out past polls.