DEV Community

Discussion on: 13 reasons why you should not use Perl

Collapse
 
pillboxhat1 profile image
pillbox hat

I've read criticisms of perl in the past and some of them are valid, but, the above seem to come from a poor grasp not only of perl, but of languages in general. Sorry, but the average programmer who reads e.g. Learn perl in 2 hours 30 minutes, should be clear on almost all the points most of which stem from a misunderstanding of what perl arrays & hashes are and a misunderstanding of what values vs references are in general.
There's also a misunderstanding of how language parsers work too, I'll take example 11 for that. Perl does give you the convenience that for keys of perl hashes you don't have to quote the string (as long as it starts with a letter). But, why do you think an unquoted value would be interpreted as a string, how would the parser know it is a string? Would the string one as a value work in ANY other language unquoted? A bare word like that in most languages would either be a function call or macro or a syntax error, how could it ever be a string? Why would anyone be confused by that? If you don't like "inconsistency" you can avoid perl's handy skipping quotes for key strings and do it like on any other language:

%m1 = ('one' => 1);
%m2 = (1 => 'one');
print %m1;
print %m2;
Enter fullscreen mode Exit fullscreen mode

Since you don't understand even such basics, I can't go into how the usage of $/@/% (based on older shell languages, so it was mostly familiar to shell programmers) apart from having a learning curve helps the parser in order to make a more powerful syntax for the language.

Sorry to be like that, but it is rarely that I see such ignorance from someone who claims to have programming experience in multiple languages. I've used over a dozen languages over the years and always choose the right one for the job - even though I have personal favourites (yes, for a quick shell script you cannot beat the expressiveness of perl).

Collapse
 
davorg profile image
Dave Cross

Perl does give you the convenience that for keys of perl hashes you don't have to quote the string (as long as it starts with a letter).

And, importantly, as long as you're using the fat comma to create the key/value pair.