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: <%-{-{-{-<
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: [OT]: This does not look like start end (grep vice for)
by pryrt (Abbot) on Apr 11, 2018 at 15:19 UTC | |
by AnomalousMonk (Archbishop) on Apr 11, 2018 at 16:07 UTC | |
Re^2: [OT]: This does not look like start end (grep vice for)
by karlgoethebier (Abbot) on Apr 11, 2018 at 14:07 UTC | |
by AnomalousMonk (Archbishop) on Apr 11, 2018 at 15:23 UTC | |
by karlgoethebier (Abbot) on Apr 11, 2018 at 17:24 UTC |
In Section
Seekers of Perl Wisdom