On 2/25/03 1:36 AM, "Brion Vibber" brion@pobox.com wrote:
On lun, 2003-02-24 at 22:09, Jay Bowks wrote:
Hey Brion, thanks so much for doing all the work of redirecting the Wiktionary entries. How'd you change the caps so quick ? :-)))
The magic of perl scripts!
while( $x = <> ) { $x =~ s/^([[[A-Z ()]+]])/lc "$1"/e; print $x; }
Because I love syntactic sugar, I can't help saying that the above can be reduced to
while(<>) { s/^([[[A-Z ()]+]])/lc $1/e; print }
Or, using the -p tag:
perl -p -e "s/^([[[A-Z ()]+]])/lc $1/e"
to get that sedlike functionality.
wikitech-l@lists.wikimedia.org