in reply to Delete a line from files
Further to AnonyMonk's advice above, also consult perlrun about the effects of the -i, -n and -l flags; they all act to add code around the code you supply on the command line.
Update: E.g.,
See O and B::Deparse.c:\@Work\Perl\monks>perl -MO=Deparse,-p -i -n -le "/apple/||print " BEGIN { $^I = ""; } BEGIN { $/ = "\n"; $\ = "\n"; } LINE: while (defined(($_ = <ARGV>))) { chomp($_); (/apple/ or print($_)); } -e syntax OK
Give a man a fish: <%-{-{-{-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Delete a line from files
by Anonymous Monk on Oct 12, 2015 at 11:03 UTC | |
by karlgoethebier (Abbot) on Oct 12, 2015 at 11:38 UTC | |
by Anonymous Monk on Oct 12, 2015 at 21:48 UTC | |
by soonix (Chancellor) on Oct 13, 2015 at 08:56 UTC | |
by Anonymous Monk on Oct 13, 2015 at 10:08 UTC | |
|