News for hackers. Stuff that matters.
Re:Elegant Bash Conditionals by castillar76 on Tuesday March 02, 2021 @03:48PM (#26320439)
Yep, this was a common Perl construct as well, since you could follow "or die" with a custom error string. I used to amuse myself (way back in the Stone Age, when I was in college and didn't know better) by using amusing and unique invectives for error messages like 'or die "you son of a motherless goat"'. Not only did they make me giggle a little, they made searching code for the line that failed a little easier...
Re:Elegant Bash Conditionals by saurik on Tuesday March 02, 2021 @06:23PM (#26322614)
Yeah yeah yeah, but citing Perl to defend that something is readable doesn't win arguments ;P.
Re:Elegant Bash Conditionals by ycombobreaker on Wednesday March 03, 2021 @02:54AM (#26325823)
What did Larry Wall do to deserve that? Ruby cribbed the "or die" idiom (and others) from Perl because they were useful. At least let him own his good ideas along with the rest of the language.
Re:Elegant Bash Conditionals by kergonath on Wednesday March 03, 2021 @01:10AM (#26325326)
Well, some parts of Perl actually make a lot of sense.