Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!magnus.ircc.ohio-state.edu!tut.cis.ohio-state.edu!sei.cmu.edu!fs7.ece.cmu.edu!o.gp.cs.cmu.edu!andrew.cmu.edu!jb3o+ From: jb3o+@andrew.cmu.edu (Jon Allen Boone) Newsgroups: comp.lang.perl Subject: help with pattern matching Message-ID: Date: 7 Mar 91 16:27:18 GMT Organization: Carnegie Mellon, Pittsburgh, PA Lines: 21 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 | -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-