# Included code behaves different than code in place

**URL:** <https://discourse.julialang.org/t/included-code-behaves-different-than-code-in-place/52983>\
**Category:** New to Julia\
**Created:** [January 7, 2021, 11:47am UTC](https://discourse.julialang.org/t/included-code-behaves-different-than-code-in-place/52983 "2021-01-07T11:47:17Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [January 7, 2021, 11:52am UTC](https://discourse.julialang.org/t/included-code-behaves-different-than-code-in-place/52983/2 "2021-01-07T11:52:29Z")

</div>

> [@Is "include" safe to use inside a function?](https://discourse.julialang.org/t/is-include-safe-to-use-inside-a-function/10867):
>
> Is the following safe to do? #testinclude.jl a = 2 julia\> function f() include("testinclude.jl") return a end f (generic function with 1 method) julia\> f() 2

---

_[View the full topic](https://discourse.julialang.org/t/included-code-behaves-different-than-code-in-place/52983)._
