Skip to main content


Thing that just bit me because #Perl is not quite dwimmy sometimes:

```
my $foo = pop split(/bla/, $str);
```

(can't pop scalar in modern Perl and this construct puts split into scalar context I guess and that's not fun for pop)

(wanted to avoid the ugly `(...)[-1]` construct)

#perl
This entry was edited (1 week ago)
in reply to Henrik Pauli

yep, popping a scalar was found to be too dwimmy. in which case one might expect pop to provide a list context but it's not _that_ special, alas.
in reply to Bill Ricker

@BRicker fuzzix's digging for a Perl from before the ill-fated autounwrapping of references was introduced shows that the error message used to be slightly more reasonable back in the day. (mastodon.ie/@fuzzix/1165274148…)