in reply to Re^2: Doing "it" only once
in thread Doing "it" only once

Not only: if print were really a longer portion of code, you may {want,need} to refactor it into a sub, with the added overhead of a sub call (and here we're being -for once- really paranoid 'bout efficiency and micro-optimizations), which would not have been necessary at all if we had that kind of syntactic sugar...
Well, that would ask for syntactic sugar with an overhead of less than a subroutine call....

Note that with clever use of string eval you can duplicate the code without having to maintain it twice, and not have the overhead of calling a subroutine from a loop. And you can move the eval as far out as you want (so the overhead of calling it becomes small enough).

Replies are listed 'Best First'.
Re^4: Doing "it" only once
by blazar (Canon) on Sep 22, 2005 at 11:00 UTC
    Of course my original question was asked in the context of Perl6, and there my reasoning goes one. Just as obviously eval is the answer to most self-modifying-code(-like) needs in Perl5, but we all rather prefer to avoid it if possible...