# Equivalent to Perl Use Strict

**URL:** <https://discourse.julialang.org/t/equivalent-to-perl-use-strict/30129>\
**Category:** General Usage\
**Created:** [October 21, 2019, 10:55am UTC](https://discourse.julialang.org/t/equivalent-to-perl-use-strict/30129 "2019-10-21T10:55:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [October 21, 2019, 10:55am UTC](https://discourse.julialang.org/t/equivalent-to-perl-use-strict/30129/1 "2019-10-21T10:55:54Z")

</div>

Is there an equivalent in Julia of the Perl Use Strict compiler flag? This means that all variables must be declared.  
Very useful for the case I just had where I mistyped a variable name when assigning a string value (in Pythin I add) then used a different variable name to operate on it. Use Strict catches typos like this.

I may have asked the same question some time ago…

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [October 21, 2019, 11:15am UTC](https://discourse.julialang.org/t/equivalent-to-perl-use-strict/30129/2 "2019-10-21T11:15:04Z")

</div>

A variable not in local scope can still be assigned in global scope at any point before calling a function. And, strictly speaking, compilation may not actually happen before that anyway, so I am not sure how this would be useful.
