in reply to Question on arrays
The code btrott posts shows the implicit behavior. $_ is shifted/unshifted in every loop. Within the second loop, 'bar' is shifted from @arr into $_; as a result, the _explicit_ shift removes baz. When the loop ends, $_ is unshifted back onto the array but 'baz' is lost forever. @arr is reduced to 'foo bar quack'.
Of course, this could come in handy for obfuscation.
|
|---|