Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is using labels in Perl subroutines considered a bad practice?

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?

like image 875
Geo Avatar asked Oct 28 '09 08:10

Geo


1 Answers

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.

like image 174
innaM Avatar answered Sep 17 '22 16:09

innaM