in reply to difficulty in understanding use of @_ and shift in a subroutine

Note that while shift operates on @_ by default in a subroutine, in the main body of a script it operates on @ARGV, i.e. arguments supplied on the command line. This one-liner illustrates that.

$ perl -E 'say $x while $x = shift' aaa bbb ccc aaa bbb ccc $

I hope this is of interest.

Cheers,

JohnGG