good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Best way to edit a file?by leocharre (Priest) |
on Apr 02, 2007 at 17:00 UTC ( [id://607875]=note: print w/replies, xml ) | Need Help?? |
Imagine you're editing a site. Some email is spelled wrong so.. you gotta open up 40k lines of html code some stupid wysiwyg spat out. .. oh dear... well.. find ~/public_html -type f -name "*.htm" -exec perl -i -pe 's/wrongo\@hi\.com/righto\@yo\.net/sig' '{}' \;I know of a case where we had a client come in, and they had hired someone full time for 6 months to fix things in hand made html that would have taken a posix monkey five seconds to do.
In Section
Seekers of Perl Wisdom
|
|