Useful perl One-liners

Thanks to Peteris Krumins ( @pkrumins), here it is, a nice and thorough page about perl one-liners! : source : http://www.catonmat.net/download/perl1line.txt Useful One-Line Scripts for Perl Jan 28 2012 | version 1.08 ——————————– ———– ———— Compiled by Peteris Krumins (peter@catonmat.net, @pkrumins on Twitter)

Share Button

Inserting a line in a file with perl (sed -i doesn’t work on AIX)

The following line will insert « blah blah blah » at the beginning of the file.txt . If you wanna insert a line anywhere else, you just have to modify this « if $. == [line number] » part. If you just wanna modify

Share Button