in reply to Re: substr odd behavior with list arguments
in thread substr odd behavior with list arguments

... And that's the "how," to make Perl act the way I want. Maybe I won't, though -- it might not be prudent to change the prototype on this low-level call. Thanks!
  • Comment on Re^2: substr odd behavior with list arguments

Replies are listed 'Best First'.
Re^3: substr odd behavior with list arguments
by haukex (Archbishop) on Mar 22, 2021 at 16:46 UTC
    it might not be prudent to change the prototype on this low-level call

    Note you're not changing it, just telling Perl to ignore it for that one call, meaning you get Perl's standard behavior of flattening the argument list. But indeed it means that you need to be certain that your subroutine will always return the offset and length; the workaround that choroba showed at least gives you the oppertunity to check that. And LanX's suggestion to wrap it in a sub is also good.