Sujet : on Perl (was: Command Languages Versus Programming Languages)
De : invalid (at) *nospam* invalid.invalid (Javier)
Groupes : comp.unix.shell comp.unix.programmer comp.lang.miscDate : 14. Apr 2024, 21:41:28
Autres entêtes
Message-ID : <Mkidnafag8vlooH7nZ2dnZfqn_idnZ2d@brightview.co.uk>
References : 1 2 3 4 5 6
In comp.unix.shell Janis Papanagnou <janis_papanagnou+
ng@hotmail.com> wrote:
I've programmed in Perl but I'm no Perl-programmer notwithstanding.
Some more or less obvious reasons I see...
Abstraction of diverse Unix utilities' interfaces.
(...)
Supporting data structures (beyond primitive arrays).
Less quirks than Shell. (I'm saying that as an experienced Shell programmer.)
I find perl much more quirky. Among many other things, it lacks an
straightforward support of nested data structures (you neeed to use
something called references), as it flattens nested arrays automatically.
That was an erroneous early design decission.
$ clisp <<< "(print '(1 2 3 (4 5)))"
...
(1 2 3 (4 5))
$ python3 <<< "print((1,2,3,(4,5)))"
(1, 2, 3, (4, 5))
$ perl -e "use Data::Dumper; @a=(1,2,3,(4,5)); print Dumper(\@a)"
$VAR1 = [
1,
2,
3,
4,
5
];
That being said, no other language comes close in conciseness when it
comes to text processing and interacting with the OS (filesystem, pipes, etc).
Any other language is too verbose for those tasks.
https://wiki.c2.com/?WhyLovePerl