Popping an arrayref off an array and pushing that to another array generates incorrect code. For example (from Date::Manip::TZ): push(@periods,pop(@tmp)) if (@tmp);