Difference between revisions of "Perl"
From Teknologisk videncenter
m |
m |
||
Line 1: | Line 1: | ||
{{Under construction}} | {{Under construction}} | ||
*[http://en.wikiversity.org/wiki/Topic:Perl wikiversity] perl | *[http://en.wikiversity.org/wiki/Topic:Perl wikiversity] perl | ||
+ | = One liners = | ||
+ | == Search and replace in files == | ||
+ | You could also use find and sed. | ||
+ | <pre> | ||
+ | perl -pi -w -e 's/SEARCH/REPLACE/g;' *.php | ||
+ | </pre> | ||
+ | *e means execute the following line of code. | ||
+ | *i means edit in-place | ||
+ | *w write warnings | ||
+ | *p loop | ||
+ | |||
[[Category:Perl]][[Category:Programming]] | [[Category:Perl]][[Category:Programming]] |
Revision as of 06:59, 21 May 2009
- wikiversity perl
One liners
Search and replace in files
You could also use find and sed.
perl -pi -w -e 's/SEARCH/REPLACE/g;' *.php
- e means execute the following line of code.
- i means edit in-place
- w write warnings
- p loop