XP is just a number | |
PerlMonks |
Re: "Correct" program style questionsby Aristotle (Chancellor) |
on Oct 26, 2002 at 00:00 UTC ( [id://208179]=note: print w/replies, xml ) | Need Help?? |
Here's a condensed form that can correctly differentiate all cases as per sauoq's requirements elsewhere in this thread. It certainly isn't something for the beginner's class though.
But any remotely hubristic programmer will of course write this:
This will call untaint_fail only when the regex failed, and preserve undef vs empty string where they're valid input. Update: Oops. The code would previously leave things tainted since it was assigning $1 back to the tainted variable. Shifting things around minorly fixed that. Makeshifts last the longest.
In Section
Seekers of Perl Wisdom
|
|