[TxMt] Problem with perl snippet (bundle or Textmate?)

Allan Odgaard allan at macromates.com
Fri Jan 28 16:36:53 UTC 2005


On Jan 28, 2005, at 17:23, Gregg Thomason wrote:

> I want a perl snippet that does this: [...]
> 1. The "entry point" is always $2. (in other words, type 'openTAB', 
> get the snippet, but the insertion point is at $2)

That's strange -- and I can't reproduce. What version of TM are you 
using? And you're sure the problem isn't with your tab-key (making two 
tabs)? ;)

> 3. escaping the $! with something like \$! has no effect; it always 
> inserts '!n'. I even tried \\n and variations thereof with $! to no 
> effect.

It should be “\$!\\n”.

> I'm not sure if this is a side effect of the Perl syntax rules/bundle 
> [...]

Shouldn't be.

> As a side note, I want $1 and $3 to be the same thing; is it enough to 
> just call 'em both $1?

Yes, I changed your snippet to this:

open($1, "$2") or die "Can't open file: \$!\\n";
while(<$1>) {
$3
}

Here's how it looks when I use it: 
http://macromates.com/movies/perl_snippet.mov




More information about the textmate mailing list