Not necessarily, the reasons are somewhat subtle. This comment https://github.com/JuliaLang/julia/pull/19324#issuecomment-356339747 and the next one are good explanations. There is also a whole discussion thread on possibly changing this behavior in future versions because your same question keeps popping again and again.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| UndefVarError: linspace not defined | 40 | 41522 | July 30, 2020 | |
| REPL and for loops (scope behavior change) | 42 | 15310 | September 16, 2020 | |
| Variable not declared | 3 | 424 | December 17, 2020 | |
| Another possible solution to the global scope debacle | 231 | 19950 | November 6, 2018 | |
| Problem variable declaration | 6 | 636 | December 26, 2021 |