I find that using labels inside Perl subroutines, to break from multiple loops, or to redo some parts with updated variables, very helpful. How is this coding style seen by the community? Is using labels inside subroutines frowned upon?
No. They serve exactly the purpose your describe and I consider them a nice feature of the language that gets used too little.
On the other hand, whenever I find myself pondering the use of a label, I also find myself wondering whether my code needs a little refactoring.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With