in reply to Ambiguity of @{ shift }

Compare

my @shift; @{shift} = ( 0, 8, 8, 7.5, 8, 8.5, 0 ); my @weekday = qw(sun mon tue wed thu fri sat); for (0..$#shift) { printf "On %s I work %s hours", $weekday[$_], $shift[$_]; };

against your function. @{STRING} is a way to access the array variable @STRING, at least as long as no strict 'refs' is in effect. For example the stupid idea to access a variable by its name could be implemented like that. The conflict arises because Perl and perl don't know whether you meant the string "shift" or the function shift, so it doesn't know what to do, and decides for one of the two but warns you of the other possibility.