NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Re: (Score:1)
I share your instinct and to refactor this, but your refactored version would strike me as odd immediately upon finding it: why
grep { $_ } map { $foo }when that’s exactly the same asgrep { $foo }?And I think the interpolation is just too clever. It also makes it unnecessarily hard to add or remove method calls that may not follow this naming scheme, should that ever be necessary. So I’d simply say
Re: (Score:1)
qw(
table_for_class
indexes_for_class
constraints_for_class
view_for_class
insert_for_class
update_for_class
delete_for_class
);
?
You can't introduce side affects in a grep block. $_ always comes out the left side regardless of what happens inside the grep block (which is why you would want a grep {$_} map {$foo} pattern).
Reply to This
Parent
Re: (Score:1)
Ack! Of course. Sigh.
I guess one could use
but I’m not sure how well advised that is…