# @eval in loop error

**URL:** https://discourse.julialang.org/t/eval-in-loop-error/15889
**Category:** General Usage
**Created:** [October 4, 2018, 4:25pm UTC](https://discourse.julialang.org/t/eval-in-loop-error/15889 "2018-10-04T16:25:43Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)
#### Post date: [October 4, 2018, 5:06pm UTC](https://discourse.julialang.org/t/eval-in-loop-error/15889/2 "2018-10-04T17:06:59Z")

</div>

`cij` is only defined in the local scope of the loop but `eval` always evaluates in the global scope. Adding a `global` in front of the `cij=...` should do the trick. But IMO you should refactor your code to not need an eval.

Also, you as a veteran should know how to quote code, please do it: [PSA: how to quote code with backticks](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530)

---

_[View the full topic](https://discourse.julialang.org/t/eval-in-loop-error/15889)._
