Oliver Block schreef: > Sonika Sachdeva: >> How do I use variable string value as a regular expression? > > print $line if $line =~ /$pattern/;
Often you want to have special characters quoted: /\Q$pattern\E/ and print for $line; See also qr// in perlop. -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>