in reply to Re: What is the logical error here (Fixed, but I want to understand)
in thread What is the logical error here (Fixed, but I want to understand)

Does "split() no longer modifies @_" mean that it will not return the output of its call to the variable @_? As in,  split(\/t\, $line) will not work, but  my @array = split(\/t\, $line) will work?

Replies are listed 'Best First'.
Re^3: What is the logical error here (Fixed, but I want to understand)
by haukex (Archbishop) on Jun 07, 2019 at 14:53 UTC
    Does "split() no longer modifies @_" mean that it will not return the output of its call to the variable @_? As in, split(\/t\, $line) will not work, but my @array = split(\/t\, $line) will work?

    Yes, that's it. In your first piece of code, you were using split in "void context" because you weren't doing anything with the return value, in which case Perl before v5.12 used to store split's return value in the @_ variable, which is why you could access it via $_[0] etc. That is no longer the case, and you need to use split's return value explicitly, such as by storing it in an array, like you did in your second piece of code.