[comp.lang.perl] help with pattern matching

jb3o+@andrew.cmu.edu (Jon Allen Boone) (03/08/91)

I'm working on a program to read info from a database file and spit
out a formatted response.  I want to let the user indicate via command
line switches which database to use and then what string to search
for.  Now, my question is - once I've stored the string in a $var, how
do I match it against input from my database file.

I was trying to use the grep function, but it needs a regular
expression.  So how do I change the value of my $var into a regexp?



-=> iain <=-

-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
| "He divines remedies against injuries;   | "Words are drugs."           |
|  he knows how to turn serious accidents  |     -Antero Alli             |
|  to his own advantage; whatever does not |                              |
|  kill him makes him stronger."           | "Culture is for bacteria."   |
|                   - Friedrich Nietzsche  |     - Christopher Hyatt      |
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-