Think about Loose Coupling | |
PerlMonks |
Re: Quoting hash keysby eyepopslikeamosquito (Archbishop) |
on Nov 09, 2021 at 06:44 UTC ( [id://11138597]=note: print w/replies, xml ) | Need Help?? |
Bod, broader than just hashes, I encourage you to spend considerable time studying and thinking about cool ways to use Perl's many and varied ways of quoting! Time well spent. At least, this is one area where I've found Perl to be (easily) the most enjoyable language I've ever used. Perl's heredocs with variable interpolation, for example, I've found to be a joy compared to wrestling with Python's ugly triple-quoted multi-line strings. Some examples from PBP Chapter 4 (Values and Expressions), will hopefully give you a feel for where I'm coming from. While I tend to favour the q{form-of-quoting} by default, for example:
PBP gives an example showcasing how Perl allowing you to choose a different delimiter can clarify the code (by eliminating ugly escaping), making it easier to understand at a glance:
The fat-comma is also worthy of study. Conway, for example, finds this version more pleasing to the eye: than this one:
References
In Section
Seekers of Perl Wisdom
|
|