Some Dude Says
1 min readJan 12, 2020

--

Strict Perl works out to statically typed (it does some kind of JIT compiling magic before running in its VM), and weakly typed. Strict Perl just cares that you’ve declared your variable, and that it’s the right type (scalar, array, hash). So, you can throw whatever you want in that variable (1, 1.2, “cat”, a function reference, etc. for a scalar), and you can take your string “cat” and add 0 to cast it to a number (it will treat it as 0 since it has no idea how to make a numerical representation of “cat”). Javascript is most likely inspired by Perl to some degree (a lot of languages of the time were for transparent, on the fly type conversions).

--

--

Some Dude Says
Some Dude Says

Written by Some Dude Says

I write about technology, linguistics (mainly Chinese), and anything else that interests me. Check out https://somedudesays.com for more from me!

No responses yet