3 ms·
> The push function works like this because it uses an obscure feature called function prototypes. Which is rarely mentioned in any tutorial. I think the push
by maxlybbert 12y ago
> The push function works like this because it uses an obscure feature called function prototypes. Which is rarely mentioned in any tutorial.
I think the push function behaves differently mainly because it's a builtin. It is possible to use function prototypes to make your functions act like builtins, but the reason that isn't mentioned in tutorials is that most Perl programmers are less than impressed with prototypes. Except when passing code blocks as subroutine references, since prototypes allow you to omit the comma after the code block.