Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I seem to recall the * operator being required for those parameter-binding semantics. Has the the unary splat been cancelled, or am I mistaken?
    • The unary splat * takes an aggregate, or reference to an aggregate, and flatten them out on the invocation list. Unary splat on hash arguments flattens it out as pairs for named bindings; splat on scalars deref it to find an array/hash reference; for code and non-reference-to-aggreate scalars it's a no-op.
      • Which is why I don't understand why it's not required in foo($y). It seems to me foo(*$y) should assign 3 to $x, and foo($y) should assign $y to $x no matter what $y is.
        • Pair is not an aggregate. I thought the same way you did, too, but Larry ruled that Pair, like Junction, is not Item (which is the default for parameter types). To accept Pair, declare it as such, or Object, or Any.