News for hackers. Stuff that matters.
Re:Interviewing programmers: coding test example explained by shabble on Thursday June 03, 2010 @12:42PM (#1401779)

     perl -pe'BEGIN { $x = quotemeta(shift) } s/$x//g;'
should do what you want. `quotemeta' is the function that does the escaping for your properly.

I was hoping to be able to use tr///, since it seems like it was built for this, but it creates its conversion tables at compile time, so there's no chance to interpolate the argument without some nasty nasty eval'ing.

Re:Interviewing programmers: coding test example explained by nevinera on Thursday June 03, 2010 @01:15PM (#1401872)
Yeah, tr was my instinct as well.. Thanks for quotemeta, it helps with something I'm working on right now!