Just because the code doesn't confirm to your latest language standards and flavor-of-the-month Javascript-framework doesn't mean it is silly or insecure.
In fact you even acknowledge this in the last paragraph. This sounds like a cheap stab at Perl.