On Tue, Apr 24, 2012 at 08:24:40PM +0200, Johan Vromans wrote: > "Father Chrysostomos via RT" <perlbug-followup@perl.org> writes: > > > How about ‘given’? I would love to be able to override it with > > something that actually works, in which case I would need ‘when’ as well. > > > > How about being able to override ‘if’ to make if(<>) dwim? How about > > overriding ‘while’ to make a non-dwimmy do-what-I-say version? These, > > of course, don’t have to be global overrides. > > My first reaction to this thread was: override okay, but then as a set > of keywords. if, else and elsif go together. given, when etc likewise. > > I can easily imagine a pragma that changes the behaviour of such a set > of keywords. > > But just overriding keywords like if independently... Yuck. > > BTW, for the if(<>) dwim, I'd consider overriding the readline function > instead. given/when are actually independent keywords - they are actually more like for/next/last/etc. (whether this is actually a good idea is debatable, but that is how they work currently). Overriding elsif outside of the context of if() doesn't actually make any sense - elsif isn't (or shouldn't be, anyway) a keyword on its own, it is just a token that is an expected part of parsing an if statement. -doyThread Previous | Thread Next