[ale] Perl question

Matthew Brown matthew.brown at cordata.net
Tue Jul 2 13:07:50 EDT 2002



I am reading in the 
Camel book (p.332) about the following command line:
<FONT face=Arial 
size=2> 
$ perl -p -i.bak -e 
"s/foo/bar/;"
<FONT face=Arial 
size=2> 
Now, the way I read 
it, it should take the file given to it (via a command line as below), open 
it, swithc all instances of 'foo' with 'bar', then close the file, giving you a 
backup of the original file named 'originalfilename.bak'.  Is this 
right?
<FONT face=Arial 
size=2> 
The command I 
am running follows:
<FONT face=Arial 
size=2> 
$ find . -name 
"*.php" -maxdepth 3 | perl -p -i.bak -e "s/foo/bar/;"
<FONT face=Arial 
size=2> 
On my box, this 
simply tries to change 'foo' to 'bar' in the file _names_ handed to it.  
What am I missing?
 
Best regards,
Matthew Brown, President
CorData, Inc.
O: (770) 795-0089
F: (404) 806-4855
E: <A 
href="mailto:matthew.brown at cordata.net">matthew.brown at cordata.net
 




More information about the Ale mailing list