Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-17 Thread Kripa Sundar
Dear Ben, Tim and others, I've been learning a lot from this entire thread. Thanks to all the responders. Tim writes: [...] [W]e can indeed add another item to Kripa's list: * context confusion eval() executes in the context in which it's called, not the context in which the

Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-17 Thread Uri Guttman
KS == Kripa Sundar [EMAIL PROTECTED] writes: KS Dear Ben, Tim and others, KS I've been learning a lot from this entire thread. Thanks to all the KS responders. i just want to reiterate my view on string eval (and symrefs). they are powerful tools that are needed to solve a certain class

Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-17 Thread Kripa Sundar
i just want to reiterate my view on string eval (and symrefs). they are powerful tools that are needed to solve a certain class of problems. they rarely are the best solution [...] so my rule again (and kripa, tell your cow-orker this one) is: you should not use string eval (or symrefs)

Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-16 Thread Tim King
Ben Tilly wrote: I agree that using eval here is wrong. But I still don't see action at a distance. You can argue about whether it is action at a distance, but you have tight coupling between the internals of make_generator and the string passed into it that was generated from very far

Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-16 Thread Ben Tilly
On 8/16/05, Tim King [EMAIL PROTECTED] wrote: Ben Tilly wrote: I agree that using eval here is wrong. But I still don't see action at a distance. You can argue about whether it is action at a distance, but you have tight coupling between the internals of make_generator and the string

Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-16 Thread Tim King
Hi, Ben. I began crafting an on-list reply, only to find I had nothing substantive to add. Then I began writing a private message, only to discover that perhaps this still makes interesting discussion. Now I'm thinking we may be on to something here that actually applies directly to the

Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-15 Thread Kripa Sundar
Dear Uri, Thanks to you and the others for your prompt responses. another bad point about eval is that it can access and modify lexicals and globals anywhere in the code. so that can lead to action at a distance and very hard to find bugs. I don't quite follow. Globals are anyway

Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-15 Thread Kripa Sundar
Dear Tom, You seem to be blending the concepts of eval and system. Sorry about the confusing presentation there. My friend had actually written something like: --\/BEGIN-\/-- $string = system(\cat $somefile | mail -s \\\$something\\\

Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-15 Thread Ron Newman
On Aug 15, 2005, at 11:17 AM, Kripa Sundar wrote: I asked him to re-write it as: system(cat $somefile | mail -s '$something' $audience); Which of course should really be written as: system(mail -s '$something' '$audience' $somefile); ___

Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-15 Thread Kripa Sundar
Which of course should really be written as: system(mail -s '$something' '$audience' $somefile); Yes, of course. It is one of the classic useless uses of cat(1). I had meant to write this also to my friend, but forgot in my indignation over six backslashes. :-) peace,

Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-15 Thread Kripa Sundar
Dear Ben, another bad point about eval is that it can access and modify lexicals and globals anywhere in the code. so that can lead to action at a distance and very hard to find bugs. [...] I'm not sure if this is what is referred to, but it applies. If this is dynamic code where

Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-15 Thread Ben Tilly
On 8/15/05, Kripa Sundar [EMAIL PROTECTED] wrote: Dear Ben, another bad point about eval is that it can access and modify lexicals and globals anywhere in the code. so that can lead to action at a distance and very hard to find bugs. [...] I'm not sure if this is what is

Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-15 Thread Bob Rogers
From: Kripa Sundar [EMAIL PROTECTED] Date: Mon, 15 Aug 2005 14:04:48 -0400 Dear Ben, another bad point about eval is that it can access and modify lexicals and globals anywhere in the code. so that can lead to action at a distance and very hard to find bugs. [...]

Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-14 Thread Mark J. Dulcey
Kripa Sundar wrote: I could think of three problems with eval(), and replied to him with the three points below. Please let me know if I have gotten anything wrong below. Also, if you can think of more eval() concerns, please help me learn. TIA. I think you've pretty well covered the

[Boston.pm] Trying to learn about the problems with eval()

2005-08-14 Thread Bob Rogers
From: Kripa Sundar [EMAIL PROTECTED] Date: Sun, 14 Aug 2005 18:15:08 -0400 Dear fellow mongers, I saw a friend using an eval() where it was unnecessary. Of course, eval() is a valuable tool, with many valid uses. But in this specific instance, it was truly unnecessary, and so

Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-14 Thread Uri Guttman
MJD == Mark J Dulcey [EMAIL PROTECTED] writes: MJD Kripa Sundar wrote: I could think of three problems with eval(), and replied to him with the three points below. Please let me know if I have gotten anything wrong below. Also, if you can think of more eval() concerns, please

Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-14 Thread Tom Metro
Kripa Sundar wrote: I saw a friend using an eval() where it was unnecessary. (The code he used was eval $string, where the value of $string was known at compile-time.) [...] * delayed error detection and impact on correctness: If there is a typo in the system() string that you

Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-14 Thread Uri Guttman
TM == Tom Metro [EMAIL PROTECTED] writes: TM Your comments about doing something that has life beyond the process TM itself and incomplete run seem a bit muddled and not consistent with TM how eval behaves. Yes, as another poster pointed out, if you don't check TM $@ after an eval, an