Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Don't forget sigils. Because the difference between @foo and $foo is obvious, right?



Not to someone who doesn't know Perl. But this is the same for every language. No one should be picking up a new language and working with it if they don't know it.

EDIT: To clarify, I mean there should never be the expectation that you can start working in a language in earnest without properly learning it.


That difference is indeed obvious. The issue is sigil variance.


Highlighting sigil variance was my point, poorly stated.


Perl5 does not have "sigils", BASH, BASIC and Perl 6 have sigils.

Perl 5 has dereference operators, which got called "sigils" by lazy documentation and book authors.


@ → A → array

$ → S → scalar

That's how I learned and remember them.

What makes that less obvious is when you work with references to arrays; the reference itself is a scalar, so it gets the scalar sigil. You can dereference it, though, by sticking an array sigil in front of it, thus telling the interpreter "hey, this is a scalar reference to an array".




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: