Why do Perl variables need to start with $, %,@ (sigils)?

When I started out using Perl it was explained to me that these characters were chosen because:

  • $ looked a bit like an ‘s’ so that was for scalars,
  • @ has an ‘a’ in the middle so that was for arrays, and
  • % was for hashes because it looked like a key-value pair divided by a slash.

Leave a Comment