SPUG: reg exp generator

Baker, Stephen M stephen.m.baker at intel.com
Mon Jul 29 15:44:49 CDT 2002

I have a program needing with the following array:

@LINES	=	qw(	#any line from file here


That at the present time I want to do the following:

foreach $line (@LINES){
	$line =~ s/$line/$CONSTANT_MOD_LINE/

The goal is that a user can put a line from an output file into the array,
and my program will take the line and essentially comment out any lines in
all files that contain the user's selected line... however, my original idea
was to do this using regular expressions and since some lines have a or
multiple period(s) or asteric(s) the reg exp is giving me some trouble...
any ideas on how to change ordinary text, especially periods and asterics
into reg exp friendly characters?

Stephen Baker				Office:	253.371.4188
Intel Corporation				Mobile:	253.678.0556 
Intel Architecture Group			Email:
stephen.m.baker at intel.com

Mail Stop DP3-307	2800 Center Dr.		Dupont, WA 98327

The information contained in this email are the opinions and views of the 
author(s), and are not on behalf of Intel unless specifically stated.

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org

More information about the spug-list mailing list