Table of Contents
    Home / Definitions / Sigil
    Languages 1 min read

    A sigil is a symbol used in some programming languages to indicate different program features. BASIC and Perl are two of the most popular languages to use sigils. Typically, the sigil initializes a variable, collection of variables, collection of characters, or string. In BASIC, for example, the sigil $ indicates a variable with a string.

    In the Perl programming language, @ designates an array, which is a collection of variables that have similar data types. $ designates scalars or variables that hold a specific value.

    In Elixir, sigils can introduce different elements in programming: ~s initializes a string, while ~S initializes a raw string literal (which does not allow escapes). ~w is used to separate a list of words:

    ~w (word word word)