in reply to Re^6: Shifty Politics
in thread stoping and restarting a loop
I'd rather have two dozen shifts than a single goto.
I wonder if that particular form of goto were renamed to
forward_my_args_without_the_need_to_build_a_new_stackframe_or_replicate_the_args_array()
would you still be so reluctant to use it? (Apart from the stupid long name of course:)
moving the @_ check to the front of the subroutine might not be viable
An example of when this might be the case?
I still can't see why using shift is better in any respect
I don't think I ever said it was better. I just fail to see why one peice of perl syntax should be eshewed simply on the basis of prejudice.
My use in the original code was simple, clear, precise and correct. The only example you have given as to why it should not be used that (to me) holds water, is your example of making it easier to debug if @_ is left intact, but even then, placing a breakpoint on the initial list assignment goes a long way to negating that arguement. Especially as you are advocating using shift to obtain the first arguement where that happens to be a class handle.
As for where I would draw the line, a guess that would be wherever it makes most sense given the particular example I am coding. Given time and more experience with perl, this could change.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Shifty Politics
by tadman (Prior) on Sep 10, 2002 at 22:23 UTC | |
by BrowserUk (Patriarch) on Sep 10, 2002 at 23:00 UTC | |
by tadman (Prior) on Sep 11, 2002 at 01:36 UTC |