BillKSmith has asked for the wisdom of the Perl Monks concerning the following question:
#!perl -i.bak my @input = <>; if (!scalar grep {/Friday/} @input) { splice @input, 1, 0, "Friday\n"; } print @input;
using Strawberry perl on windows 7
perl -v This is perl 5, version 30, subversion 2 (v5.30.2) built for MSWin32-x +64-multi-t hread
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Command Switch -i prints to screen not file
by ikegami (Patriarch) on Dec 29, 2020 at 17:41 UTC | |
|
Re: Command Switch -i prints to screen not file
by haukex (Archbishop) on Dec 29, 2020 at 18:04 UTC | |
by BillKSmith (Monsignor) on Dec 29, 2020 at 21:38 UTC | |
by LanX (Saint) on Dec 29, 2020 at 22:36 UTC | |
by hippo (Archbishop) on Dec 29, 2020 at 23:19 UTC | |
by LanX (Saint) on Dec 30, 2020 at 00:29 UTC | |
|
Re: Command Switch -i prints to screen not file (up-guessed)
by LanX (Saint) on Dec 29, 2020 at 17:36 UTC |