On 16 Mar 2008, at 00:44, Fletcher T. Penney wrote:
[...] It appears to be that TextMate is interpreting the '$' as a variable indicator, since the output is inserted as a snippet..
[...] $add_to_index = 0; while ($line =~ s/(?<!\)$/\$/m) { $add_to_index++; }
You want to escape $, `, and \ (all three are interpreted when inserting as snippet).
So probably this regexp subst. is more appropriate:
s/(?=[$`\])/\/