in reply to Re: referances of hashes, and subroutines
in thread referances of hashes, and subroutines
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: referances of hashes, and subroutines
by zer (Deacon) on Apr 22, 2006 at 20:25 UTC | |
by GrandFather (Saint) on Apr 22, 2006 at 20:35 UTC | |
by ff (Hermit) on Apr 23, 2006 at 01:05 UTC | |
by tempest (Sexton) on Apr 22, 2006 at 20:30 UTC |