Re:The temptation of writing shell scripts, illustrated
by contingencies on Sunday April 24, 2022 @03:48AM
(#31142057)
perl 5 was great but it broke down as soon as you needed a depth or complexity of data structure. The number of times you had to man perldsc ... every single one had a different syntax for declaration and dereferencing ... AoAoHoHoAARGH!
[ Parent
| on HN ]
Re:The temptation of writing shell scripts, illustrated
by ryl00 on Sunday April 24, 2022 @08:30AM
(#31143390)
I have the opposite problem... I find perl's data structures so ridiculously easy to write that I can quickly build up arrays of hashes of arrays of (ad infinitum) while in the "flow". Throw in the ability to actually get references to things, and control de-referencing of things, and I've never felt perl has stopped me (for better or worse!) from doing anything with data structures.
Re:The temptation of writing shell scripts, illustrated
by zengargoyle on Sunday April 24, 2022 @08:33AM
(#31143401)
$ perl -E 'my $f=[[{X=>{Y=>["FOO"]}}]]; say $f->[0][0]{X}{Y}[0];my $g=$f->[0][0]{X}{Y}; say $g->[0]'
FOO
FOO
Seems pretty trivial.
Re:The temptation of writing shell scripts, illustrated
by contingencies on Sunday April 24, 2022 @08:57AM
(#31143513)
Yeah now try iterating. What used to get me is for some types $ is used only when de-referencing. It was terrible trying to track those errors down. Basically I loved perl but the language has a terrible design, inexcusable really. There was essentially no point in having types, it took all the worst parts of C and then reinvented them slightly differently with new syntax, twice per datatype. Glad to be rid of it.