shift and pop are part of the language and are more like operators than subroutines. They can therefore do magic that is not available to mere mortals.
Others will very likely show ways of doing what you would like using deep Perl magic. But in most cases doing such stuff is likely to cause grief in the long run as your eye becomes accoustomed to Perl and gets confused by special magic.
The simple rule is that Perl passes by value. If you want a reference to something then you have to do that explicitely. Confounding that rule (by invoking special magic) will, in the long run, cause trouble because the reader of the code must check every subroutine to see if it might alter parameters in unexpected ways.
In reply to Re^2: referances of hashes, and subroutines
by GrandFather
in thread referances of hashes, and subroutines
by tempest
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |