Cool.  That's way better than using sed.   I wish I'd known this at
my last job.  
-Chris   

-----Original Message-----
From: Peter Goggin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 1:08 AM
To: Bakken, Luke; [EMAIL PROTECTED]
Subject: Re: Use of Perl for global changes


Thanks, that worked perfectly.
Regards

Peter Goggin
----- Original Message ----- 
From: "Bakken, Luke" <[EMAIL PROTECTED]>
To: "Peter Goggin" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, June 25, 2003 1:06 AM
Subject: RE: Use of Perl for global changes


> cd /whatever dir
> perl -i.bak -pe's/\bmysql_pconnect\b/mysql_connect/g' *
> 
> If everything is OK, delete the *.bak files.
> Luke
> 
> > -----Original Message-----
> > From: Peter Goggin [mailto:[EMAIL PROTECTED] 
> > Sent: Tuesday, June 24, 2003 8:08 AM
> > To: [EMAIL PROTECTED]
> > Subject: Use of Perl for global changes
> > 
> > 
> > I have two web sites with about 300 htm and php files. I wish 
> > to make a change so tht the database connect string in all of 
> > these files is changed for mysql_pconnect to mysql_connect. 
> > Can perl do this and if so can anyone show me how? 
> > 
> > Ideally I would like to feed a script or command line with a 
> > list of files using ls .
> > 
> > Regards
> > 
> > Peter Goggin
> > 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

_
This message and any attachments are intended only for the use of the addressee and
may contain information that is privileged and confidential. If the reader of the 
message is not the intended recipient or an authorized representative of the
intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this communication in
error, please notify us immediately by e-mail and delete the message and any
attachments from your system.

Reply via email to