I found goto useful in C.
char *p1 = alloc(); if (p1 == NULL) goto ERROR; char *p2 = alloc(); if (p2 == NULL) goto ERROR2; char *p3 = alloc(); if (p3 == NULL) goto ERROR3; ... return 1; ERROR3: free(p2); ERROR2: free(p1); ERROR: return 0
But with Perl's reference counting and destructors, this model isn't necessary.
In reply to Re: Number of times I've used goto in Perl
by ikegami
in thread Number of times I've used goto in Perl
by vroom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |