Anti-nuisance lawsuit warning: The purpose of these notes is to remind me, Zoegond, of stuff or to help me work stuff out. They may contain mistakes.

Quick

  • ($a, $b....) = unpack("A2A7...", $packed)
  • push( array, list )

Thursday, May 1, 2014

Perl returned list

Ooh that's interesting. If a sub returns a list
sub a {
return ("name", 99);
}
but it's assigned to a scalar
$f = a();
the value assigned seems to be the last item in the list (which you'd expect if you thought about list items being pushed onto a stack in order) and not the first item, and not the scalar value of the list either (the number of items).

Followers

Blog Archive