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 )

Tuesday, July 30, 2013

Perl split

split doesn't return empty string items for trailing delimiters - split(/;/, "a;;;") returns just 1 item, "a".

Similarly in the degenerate case where the string consists entirely of delimiters, no items are returned at all.

Leading delimiters, on the other hand, generate empty items as you'd expect. split(/;/, ";;a") returns 3 items - ("", "", "a").

Followers

Blog Archive