in reply to Re: 'while', 'foreach' not in perlfunc
in thread 'while', 'foreach' not in perlfunc

I believe that in Perl 6 they will become (more akin to) real functions, but that's not the case as of now.
They will never be quite like ordinary functions, because they violate the "no two terms in a row":
# while: while $cond { $statements } # ordinary funtion: my_while $cond, { $statements }; # allowed in ordinary functions: my_while $cond, █ # not allowed in builtin while: while $cond █

while is parsed like this in STD.pm:

rule statement_control:while {\ <sym> [ <?before '(' [[my]? '$'\w+ '=']? '<' '$'?\w+ '>' ')'> #' <.panic: "This appears to be Perl 5 code"> ]? <EXPR> {*} #= exp +r <pblock> {*} #= blo +ck {*} }

So it's still special-cased. (It would be even without the check for Perl 5 constructs)