Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Creating an index on a string-collection

by AnomalousMonk (Bishop)
on Feb 09, 2009 at 02:14 UTC ( #742314=note: print w/replies, xml ) Need Help??


in reply to Re: Creating an index on a string-collection
in thread Creating an index on a string-collection

I can understand that oophoroepilepsy matches against oophoro* (with the '*' wildcard at the end), but how does otomyces match against *otomy (with the '*' wildcard at the beginning)?

Shouldn't '*otomy' (and '*botomy', for that matter) match against something like 'phlebotomy'?

What is the significance of the position of the wildcard character in the search string?

  • Comment on Re^2: Creating an index on a string-collection

Replies are listed 'Best First'.
Re^3: Creating an index on a string-collection
by samtregar (Abbot) on Feb 09, 2009 at 03:23 UTC
    Hey, reverse() on a scalar doesn't reverse it! I wonder why I thought it did. Fixed code will go in the original node in a moment. I'm sure there are other bugs though - this was just example code!

    -sam

      It does in  scalar context:
      >perl -wMstrict -le "my $s = 'foobar'; print reverse $s, 'zot'; print scalar reverse $s, 'zot'; " zotfoobar tozraboof
        Ah, thanks. Someday, when Perl is long gone, I'm not going to miss caring about what context my function calls are in!

        -sam

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2020-08-07 14:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which rocket would you take to Mars?










    Results (45 votes). Check out past polls.

    Notices?