go ahead... be a heretic | |
PerlMonks |
Re^7: De-googleizing translation scriptsby bliako (Monsignor) |
on Nov 29, 2022 at 10:13 UTC ( [id://11148432]=note: print w/replies, xml ) | Need Help?? |
good start!
Note that you can pack all into a hash from the beginning avoiding myriads of loose variables:
Also, the sub get_... (secrets) is a good example where error checking is important. The sub itself does not check whether it found the secrets pair in the config file or whether it managed to open the file. It returns a pair of possibly undefined values (if it does not bomb midway because of IO errors). And you do not check its return value: it will be a pair but will it have defined values? Personally I prefer to pass into subs hash/array refs and return back hash/array refs. In this way if it returns undef then I know an error occured.
Apropos the translation, it is impressively good. The *$&?^%$^* will sell the rope with which to be "hanged" but with the current logistics standstill, keep spinning those yarns on the ol'spindle, with Perl, hehehe bw, bliako
In Section
Seekers of Perl Wisdom
|
|