neutron has asked for the wisdom of the Perl Monks concerning the following question:
The book also shows a very neat short hand which I also cannot figure out how to use:#!perl use strict; use 5.010; $^I = "myinfo.txt.bak"; while( <myinfo.txt> ) { s/^Author:.*/Author: Johny5/; s/^Phone:.*\n//; print; }
Please help!!!$ perl -p -i.bak -w -e 's/dude/Johnny5/g' myinfo.txt
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: "Updating" files.
by GrandFather (Saint) on Jan 25, 2009 at 21:08 UTC | |
|
Re: "Updating" files.
by zwon (Abbot) on Jan 25, 2009 at 20:44 UTC | |
by neutron (Sexton) on Jan 25, 2009 at 20:57 UTC | |
by zwon (Abbot) on Jan 25, 2009 at 21:17 UTC | |
by roboticus (Chancellor) on Jan 26, 2009 at 16:05 UTC | |
|
Re: "Updating" files.
by ikegami (Patriarch) on Jan 25, 2009 at 21:09 UTC | |
|
Re: "Updating" files.
by Lawliet (Curate) on Jan 25, 2009 at 21:11 UTC | |
by neutron (Sexton) on Jan 25, 2009 at 22:48 UTC | |
by Lawliet (Curate) on Jan 25, 2009 at 23:04 UTC | |
by neutron (Sexton) on Jan 25, 2009 at 23:30 UTC |