in reply to trouble understanding code, and shift() w.o args

Try perldoc -f shift, or shift:

If ARRAY is omitted, shifts the @_ array within the lexical scope of subroutines and formats

perlvar tells you what @_ is:

Within a subroutine the array @_ contains the parameters passed to that subroutine.

I also think that all the perl introductions I've read explain this.