in reply to Reaped: Why do you need $ when accessing array and hash elements in Perl?

The $ indicates the context of what follows. The general point about sigils is an interesting one. Comparing Perl with Python (which does not have sigils on variables, but does use them elsewhere), Python does not support interpolation, so variables cannot be embedded inside double "quotes". It also has to jump through hoops to achieve things like @hash{@keys} = @values. This is not to flame Python, those guys would say the price of sigils is too high.

Perl is Open Source - there is nothing stopping you from downloading the source and altering it to do whatever you like.
  • Comment on Re: Why do you need $ when accessing array and hash elements in Perl?
  • Download Code