develooper Front page | perl.perl5.porters | Postings from January 2021

try catch except python

Thread Next
Philip R Brenan
January 25, 2021 14:10
try catch except python
Message ID:
Here is the Python equivalent of try/catch:

    x = 1/0except:
    print('Something went wrong.')

Please note that *except* does not require a parenthesised parameter list.
And if they had used *fail *instead of *except* it would have not only made
sense, but it would have been shorter and easier to spell as well.

Are we so determined to look like Java, to the very last parenthesis, that
we are willing to abandon the important Perl  traditions of using short
words, making parentheses optional and leading the way rather than being
mere followers?  As Enzo Ferrari might have said to Lee Iacocca: "Torna
alla sua grande, brutta fabbrica, a fare le sue brutte macchinine".


Phil <>

Philip R Brenan <>

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About