in reply to Re^3: Splitting array into two with a regex
in thread Splitting array into two with a regex

Since we're using prototypes, another way might look like:
sub partition (&\@\@\@) { my ($cond, $start, $true, $false) = @_; for (@$start) { push @{ $cond->() ? $true : $false }, $_; } return; } my @arr = 1 .. 9; my (@greater, @less); partition { $_ > 5 } @arr => @greater, @less; print "@greater\n@less\n";

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?