I want a perl snippet that does this:
open($1, "$2") or die "Can't open file: $!\n"; while(<$3>) { $4 }
I enter this into the snippet editor. What happens is: 1. The "entry point" is always $2. (in other words, type 'openTAB', get the snippet, but the insertion point is at $2) 2. hitting TAB after entering some text moves the insertion to $1, but any attempts to hit tab to move to the while ($3) fail; it just inserts a literal TAB. 3. escaping the $! with something like $! has no effect; it always inserts '!n'. I even tried \n and variations thereof with $! to no effect.
I'm not sure if this is a side effect of the Perl syntax rules/bundle (using the stock one, I long since abandoned mine in favor of the other, superior one :) or another weirdness.
As a side note, I want $1 and $3 to be the same thing; is it enough to just call 'em both $1?