# How to fix error UndefVarError when eval using?

**URL:** <https://discourse.julialang.org/t/how-to-fix-error-undefvarerror-when-eval-using/93503>\
**Category:** General Usage\
**Tags:** question\
**Created:** [January 25, 2023, 12:12pm UTC](https://discourse.julialang.org/t/how-to-fix-error-undefvarerror-when-eval-using/93503 "2023-01-25T12:12:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tatiana\_P](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tatiana_p/32/45801_2.png) [@Tatiana\_P](https://discourse.julialang.org/u/Tatiana_P)\
**Post date:** [January 25, 2023, 12:12pm UTC](https://discourse.julialang.org/t/how-to-fix-error-undefvarerror-when-eval-using/93503/1 "2023-01-25T12:12:19Z")

</div>

I have some string with function (curve\_expr). I need to give another name to this function and then use find\_zero for my model. Unfortunatelly, I got the error: UndefVarError(:find\_zero).  
Here are the code:

```julia
i=1
j=2
curve_name = Symbol(:f,i,j)
@eval $curve_name(w::Any) = $curve_expr
w_new = find_zero(eval(curve_name), w0)

```

Thanks for answering.

---

<div class="post-metadata">

**Author:** ![mcmuffin6o](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@mcmuffin6o](https://discourse.julialang.org/u/mcmuffin6o)\
**Post date:** [March 20, 2024, 11:21pm UTC](https://discourse.julialang.org/t/how-to-fix-error-undefvarerror-when-eval-using/93503/2 "2024-03-20T23:21:05Z")

</div>

[This](https://discourse.julialang.org/t/eval-symbol-varname-causes-undefvarerror-although-the-variable-is-defined/23726) post might help.
