in reply to Re: Re: Protect your subs... from *EVIL*.
in thread Protect your subs... from *EVIL*.

I dunno jryan,

As a matter of readability and sanity, I'd pass the variable as an argument and taint-check as neccessary. Or use constants. Do you have an example where constants or untainting globals as arguments are not the best way to go?

Just curious as to practical use. Nice bit of code though :)

.02

cLive ;-)

Replies are listed 'Best First'.
Re: Re: Protect your subs... from *EVIL*.
by jryan (Vicar) on Dec 23, 2003 at 04:19 UTC
    Just curious as to practical use.

    Well, there isn't really one. :) I just wanted to see if it could be done. I had an argument/discussion with a CS proffessor a long time ago about closures. He claimed that a true closure would copy the values of variables in scope at the moment of creation. I claimed that that would be pretty useless. At any rate, seeing diotalevi's node the other day reminded me of the discussion, and so here we are.

    Its essentially a demonstration of the full power and glory of Perl's Reflective abilities used to essentially accomplish nothing.

    By the way, even before the update, the comment on the 2nd line was there ;)