Backwards compatibility
-> It all sounds wonderful, but the price would have been the breaking of some backwards compatibility
This has been around forever, and I don't care about backwards compatibility 25 years later. I want to avoid doing this with Perl.
#!/usr/bin/perl
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
print("Year according to Perl: $year\n");
$year += 1900;
print("Fixed year: $year\n");
Year according to Perl: 122
Fixed year: 2022
Before you chime in I know that I can do:
use Time::Piece;
my $t = Time::Piece->new();
print $t->year . "\n";
That wasn't my point. My point is localtime(time) has forever been broken in Perl, and the reasons given were 'backwards compatibility'. Move on, Perl.
Then there's the Perl web site. Full of tutorials, some of which do not work. How about DNS? (https://learn.perl.org/examples/dns.html). If I copy and paste that (changing the resolver IP) and run it, do I get some DNS result? No, instead I get:
String found where operator expected at ./dns.pl line 17, near "say "Found an A record: ""
(Do you need to predeclare say?)
syntax error at ./dns.pl line 17, near "say "Found an A record: ""
Execution of ./dns.pl aborted due to compilation errors.
It's not good.