LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Why does Perl have sigils? (https://www.linuxquestions.org/questions/programming-9/why-does-perl-have-sigils-819307/)

MTK358 07-11-2010 08:01 PM

Why does Perl have sigils?
 
What are they good for, exactly?

AlucardZero 07-11-2010 09:32 PM

to tell what sort of variable is being used or (in the case of indexing an array or hash) what sort of values are returned.

bigearsbilly 07-12-2010 05:11 AM

why do other languages not?
;)

it makes it clear what is a variable and
it's context, list, scalar hash.

perl is all about context, once you grasp that
you've pretty much got it.

it's weird compared to most languages.

Sergei Steshenko 07-12-2010 06:11 AM

Quote:

Originally Posted by MTK358 (Post 4030337)
What are they good for, exactly?

To have type built-in into the variable.

wje_lq 07-12-2010 09:58 PM

And if you think sigils are nifty, wait until you start using twigils.


All times are GMT -5. The time now is 04:15 AM.