# Comments in code on eval()

**URL:** <https://www.ruby-forum.com/t/comments-in-code-on-eval/112384>\
**Category:** Ruby\
**Created:** [August 18, 2007, 4:27am UTC](https://www.ruby-forum.com/t/comments-in-code-on-eval/112384 "2007-08-18T04:27:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giles\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/848f3c/32.png) [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Post date:** [August 18, 2007, 4:27am UTC](https://www.ruby-forum.com/t/comments-in-code-on-eval/112384/1 "2007-08-18T04:27:11Z")

</div>

# note: this code uses eval(). eval()'s behind a pair of [].each calls

which filter it and make

# it safe to use. use similar precautions and be careful using eval().

also, profile it for

# performance. never expose eval() to user input. wash eval() before

and after use. do not

# eat eval() or attempt to operate heavy machinery after using eval().

let’s see if that makes it to production.

–  
Giles B.

Blog: [http://gilesbowkett.blogspot.com](http://gilesbowkett.blogspot.com)  
Portfolio: [http://www.gilesgoatboy.org](http://www.gilesgoatboy.org)  
Tumblelog: [http://giles.tumblr.com/](http://giles.tumblr.com/)

---

<div class="post-metadata">

**Author:** ![Giles\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/848f3c/32.png) [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Post date:** [August 18, 2007, 4:42am UTC](https://www.ruby-forum.com/t/comments-in-code-on-eval/112384/2 "2007-08-18T04:42:12Z")

</div>

> let’s see if that makes it to production.

Not a chance.

---

<div class="post-metadata">

**Author:** ![Giles\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/848f3c/32.png) [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Post date:** [August 18, 2007, 6:14am UTC](https://www.ruby-forum.com/t/comments-in-code-on-eval/112384/3 "2007-08-18T06:14:18Z")

</div>

On Aug 17, 2007, at 9:26 PM, Giles B. wrote:

> # note: this code uses eval(). eval()'s behind a pair of [].each calls
> 
> which filter it and make
> 
> # it safe to use. use similar precautions and be careful using eval().
> 
> also, profile it for
> 
> # performance. never expose eval() to user input. wash eval() before
> 
> and after use. do not
> 
> # eat eval() or attempt to operate heavy machinery after using eval().
> 
> let’s see if that makes it to production.

Giles, why do I feel like there’s only one tool in your toolbox? 😉

On second thought, maybe it’s just your favorite hammer…

James Edward G. II
