Yeah, you probably want
my ($x, $y, $z) = @shift;
For reference:
Valid is either
sub () { my ($x, $y, $z) = @_;
sub ($x, $y, $z) {
I should have said
my ($x, $y, $z) = @$_[0];
If $_[0] is an array reference, @$_[0] becomes a list.
The joke was a reference to most wrong Perl programs being valid for something.
Hence the meme: "93% of Paint Splatters are Valid Perl Programs"
https://www.mcmillen.dev/sigbovik/
Why the empty prototype in the first alternative?
yeah, you could leave that out, but then I have to invent a name
Really? Anonymous subroutines/coderefs are defined with sub {} are they not?
For reference:
Valid is either
orI should have said
but I was making a joke.If $_[0] is an array reference, @$_[0] becomes a list.
The joke was a reference to most wrong Perl programs being valid for something.
Hence the meme: "93% of Paint Splatters are Valid Perl Programs"
https://www.mcmillen.dev/sigbovik/
Why the empty prototype in the first alternative?
yeah, you could leave that out, but then I have to invent a name
Really? Anonymous subroutines/coderefs are defined with sub {} are they not?