You're viewing a comment by Peter Krumins and its responses.

July 31, 2009, 22:49

James, oh, I see. Here are solutions for that:

perl -pe '$_ = "$. $_" if /regex/'

Or if you don't want to print lines that did not match at all, then:

perl -ne 'print "$. $_" if /regex/'

I will modify the article to include them, thanks for the comment!

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the word "computer_150": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.