Tested these in order to learn how they work, and the first one simply deleted the 
entire contents my test file which was peppered with foo on multiple (but not all) 
lines....

----- Forwarded message from Bob Showalter <[EMAIL PROTECTED]> -----

Second, the canonical one-liner to delete lines from a file is:

   perl -ni -e 'next unless /foo/' myfile.txt

This deletes all lines matching /foo/. To only delete the first
line matching /foo/, you need something like this:

   perl -ni -e 'next unless /foo/ && !$x++' myfile.txt

----- End forwarded message -----

--

Namaste,

Kristin

"Much as I hate to say it, the Computer Science view of language design 
has gotten too inbred in recent years. The Computer Scientists should 
pay more attention to the Linguists, who have a much better handle on 
how people prefer to communicate."
         --Larry Wall

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to