perl code snippet for additional programming symbols
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 19 Aug 2015 07:58:09 +0000 (09:58 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 19 Aug 2015 07:58:09 +0000 (09:58 +0200)
Golf entry by teebee for character referencing
<http://golf.shinh.org/p.rb?Break+Lorem+Ipsum+fixed>
which includes a good amount of \W ASCII, including the common dollar sign,
slashes, and quotes.

unicode.txt

index 4e4a360daab923240c910f77c6599897d1699d55..88dd0c189f95d813f3d680565139057642d5ed2d 100644 (file)
@@ -11,6 +11,8 @@ Code:
 
   Hash[ :nbsp => 0O2_40 ].each {|name, cp| puts "#{name} is '#{cp.chr}'" }
 
+  perl -pe's/\w/$^=~$&>chop($^=$&.$^)?"@-":$&/ge'
+
 Mathematics and sciences:
 
   ∮ E⋅da = Q,  n → ∞, ∑ f(i) = ∏ g(i),      ⎧⎡⎛┌─────┐⎞⎤⎫