in reply to shift, undef and 'or die'

Is it because shift is returning zero which is evaluating to false?

The short answer is "Yes". Shift returns what it shifts, not a success. Think about it this way - it can only really return one thing.

To do this, you have to push it to a temp then do a trinary checking on defined-ness.