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.
Representative expression (Score:1)
I think you can send this to DailyWTF for their “representative line” feature. Just this line would be enough:
As an exercise, consider what it might say about the rest of the system that a mere pattern match is wrapped in an
eval.Reply to This
Re: Representative expression (Score:1)
No need to shout too widely about such code. I've heard people already know how bad Perl is
;-)All the
eval { $value =~ /$var/i }bits are because they use Perl regexps to find elements. Yes, it means$varcomes straight from user input, but it's an internal program, not accessible outside our network. I'll just remove theseevaland replace them with one$regexp = eval { qr/$var/i }and return early ifevalfails.Close the world. txEn eht nepO