Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Matching against list of patterns

by Eyck (Priest)
on Sep 16, 2004 at 13:56 UTC ( #391444=note: print w/replies, xml ) Need Help??


in reply to Re: Matching against list of patterns
in thread Matching against list of patterns

What is so scary about hashrefs?

And I don't know how to create and use such beast, how can I figure out which re of  join "|" , @res matched?

And wouldn't that strain our re engine too much (we're talking about scalability here, will hardware improvements keep such code running with number of patterns and lines to parse linearly growing? )

Replies are listed 'Best First'.
Re^3: Matching against list of patterns
by davorg (Chancellor) on Sep 16, 2004 at 15:01 UTC
    What is so scary about hashrefs?

    Absolutely nothing.

    But anything that you use as a hash key gets converted into a string. And that means that when you pull the keys back out you can no longer use them as hash references - which is what you seem to be doing.

    Can you show us the code that builds your %$users hash?

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

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://391444]
help
Chatterbox?
[karlgoethebier]: perldigious: perhaps a block if you are paranoid ;-)
[choroba]: but undef %hash and %hash = () both work, too, but the first one keeps the memory allocated, while the latter makes it available for other parts of the program.
[choroba]: iirc
[perldigious]: karlgoethebier: Well it is a pretty old and complicated (for me) bit of code I wrote (poorly by my current standards), so I'm expecting everything to break when I add the scoping and find out what else is undesireably scope changed. :-)
[perldigious]: Ah, thanks choroba, that sort of thing was precisely what I was wondering when I asked.
[perldigious]: I didn't want to tie up memory unecessarily basically, I wanted to "delete" it specifically to free it up, and wasn't sure I was even accomplishing that.

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2017-07-21 19:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (335 votes). Check out past polls.