Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: Regexp::Common not so common?

by chromatic (Archbishop)
on Aug 14, 2008 at 19:37 UTC ( #704419=note: print w/replies, xml ) Need Help??


in reply to Re^2: Regexp::Common not so common?
in thread Regexp::Common not so common?

Instead it has this crazy interface that looks like hashes of hashes but isn't (the order of the keys doesn't matter)...

The order of the keys doesn't matter in most hashes. Regexp::Common uses a tied hash to avoid compiling all of the possible regexps at compile time.

... and there's something strange about what it returns that I couldn't be bothered to figure out myself.

A compiled regular expression? They've been around for most of a decade, if not longer.

When last I looked if you tried to peek at it with the "x" command in the debugger, the debugger would crash.

Having read some of the debugger's code, I'm not surprised. Did you file a bug?

Replies are listed 'Best First'.
Re: Regexp::Common not so common?
by benizi (Hermit) on Aug 16, 2008 at 03:52 UTC
    Instead it has this crazy interface that looks like hashes of hashes but isn't (the order of the keys doesn't matter)...
    The order of the keys doesn't matter in most hashes. Regexp::Common uses a tied hash to avoid compiling all of the possible regexps at compile time.

    The order of keys matters in hashes of hashes. (e.g. $$hash{first_key}{second_key} ne $$hash{second_key}{first_key}). Bizarre as it may be, though, the odd way of accessing things in Regexp::Common is pretty clever.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2022-10-01 02:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (126 votes). Check out past polls.

    Notices?