5 ms·
Perl isn't difficult, it's just quirky: Perl OO: In Perl classes are called "packages". There are no private methods or private members, everything is mutable.
by snorkel 18y ago
Perl isn't difficult, it's just quirky:
Perl OO: In Perl classes are called "packages". There are no private methods or private members, everything is mutable.
Sigils: @foo is an array, %foo is a hash, but $foo can either be a string (scalar), a number, a reference to hash, a reference to an array, a reference to a function, or a reference to an object.
Built-in functions that operate on arrays (push, pop, foreach) do not accept references to arrays, unless put an @ sigil in front: pop $foo <-- WRONG! pop @$foo <-- Oh sure, OK!
Lots of special variables: $ in combination with just about any other non alpha character means something in perl. The most often abused is $_, the default variable.
Libraries and package files have to end with 1; or return some non-zero value.
So sure, plenty of quirks of to learn, but so every lanaguage.