http://qs321.pair.com?node_id=1212651


in reply to This does not look like start end

WRT this reply:

grep { croak "This doesn't look like start-end\n" unless /(.*)-(.*)/; push @a, $1; push @b, $2; } @cidr;
I've seen map (mis)used in place of a for-loop before (although I've never understood the attraction of this unclean practice), but never grep. Purely to satisfy my idle curiosity, can anyone speculate on the rationale for this odd syntactic tic? Why not just
for (@cidr) { croak "This doesn't look like start-end\n" unless /(.*)-(.*)/; push @a, $1; push @b, $2; }


Give a man a fish:  <%-{-{-{-<