John Evans' Blog

Success!

by on Dec.14, 2005, under Uncategorized

Today I finally succeeded at something I have struggled with every now and then for years.

What have I done? Well, check this out…


$a = "\$b = \$a;\$b =~ s/([\"\\\$\\\\])/\\\\\$1/g;print \"\\\$a = \\\"\$b\\\";\$a\";";$b = $a;$b =~ s/(["\$\\])/\\$1/g;print "\$a = \"$b\";$a";

:, ,
4 comments for this entry:
  1. Anonymous

    You’ve created a line of seemingly random code that nonetheless accomplishes something?

  2. vincentursus

    You’ve created a line of seemingly random code that nonetheless accomplishes something?

  3. johnevans

    Yes.

    Have you run it? If it wasn’t obvious, it’s Perl.

    Also, it’s not supposed to have a line break in the middle…it’s supposed to be all one line.

  4. sscougall

    I don’t have perl on hand anywhere, so I’ve been trying to interpret this by hand. I haven’t gotten very far yet, and… oh, wait. Is it printing itself out?

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...