http://qs321.pair.com?node_id=442715


in reply to Regexp do's and don'ts

Good document. I can hardly fault it technically.

A few suggestions (I am a native speaker of (British) English):

"look how cute, he's telling the obvious."

"look how cute, he's stating the obvious."

to search global

to search globally

The plural of 'regex' is sometimes written as 'regexen'. This is not a standard way of making a plural in English but it still seen quite often.

The wisdom of using strictures and taint mode has little to do with regexes. The whole section "Rules of Thumb" should be introduced as general Perl programming advice not RE specific advice. Perhaps even split this section off to a separate node.

tainted date

tainted data

they are/behave malicious

Can't make this work comfortably in English. They are malicious or they behave maliciously.

Don't trust users.

...or programs under their control.

getting president

standing for president

Check if you enter the right airplane before entering it.

Check if you are entering the right airplane before you enter it.

if both are not present.

Sorry the precedence of 'not' here is ambiguous in written English. (In spoken English it would be possible to disambiguate with intonation).

($untainted) = $tainted =~ m/(.*)/g;

($untainted) = $tainted =~ m/(.*)/;
(And you just finished warning people not to use redundant qualifiers) :-)

This way, you only show you don't know why one would use taint mode and you make taint mode useles for your script.

This could be considered insulting. There's nothing wrong with unconditionally untainting data that is known for certain to come from a trusted source.