Difference between revisions of "Perl"

From Teknologisk videncenter
Jump to: navigation, search
m (Search and replace in files)
m (One liners)
Line 2: Line 2:
 
*[http://en.wikiversity.org/wiki/Topic:Perl wikiversity] perl
 
*[http://en.wikiversity.org/wiki/Topic:Perl wikiversity] perl
 
= One liners =
 
= One liners =
 +
[[Image:Perlcomic.jpg|thumb|800px|none]]
 
== Search and replace in files ==
 
== Search and replace in files ==
 
You could also use find and sed.
 
You could also use find and sed.

Revision as of 11:27, 25 June 2010

Package wordprocessing.png Under Construction

One liners

Perlcomic.jpg

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