in reply to This does not look like start end
WRT this reply:
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 justgrep { croak "This doesn't look like start-end\n" unless /(.*)-(.*)/; push @a, $1; push @b, $2; } @cidr;
for (@cidr) { croak "This doesn't look like start-end\n" unless /(.*)-(.*)/; push @a, $1; push @b, $2; }
Give a man a fish: <%-{-{-{-<
In Section
Seekers of Perl Wisdom