If so, that's not the kind of flexibility I ever want to see in a programming language.
I hardly ever use shift like this, preferring instead the more readable argument copying:
sub PaintHouse {
my ($house, $color) = @_;
...I'm sure he thought he was making his functions easier to reuse in different contexts but in practice the actual result is that it's impossible to modify any of those functions without considering _every possible_ combination of parameters that could be passed in. Often what should be a simple fix becomes something much more time consuming.
There is a place for flexibility in software design, but the parameter list of a function is not one of those places in my opinion.
I tried Go and Typescript and realized that the extra code is really, really worth the security, refactorability and safety.
I now frown on my beloved Python for being so permissive
my $house = shift;
my $color = shift;
if (!$color) {
$color = GetDefaultHouseColor();
} my $house = shift;
my $color = shift // GetDefaultHouseColor();
At the time, I thought it made a lot of sense, after using other languages where this feature was standard and required.
However, I've since abandoned its use in Perl, because the traditional Perl way is much more flexible.
I do try to keep my `shift` statements towards the top of a sub, however.