in reply to Number of times I've used goto in Perl
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Number of times I've used goto in Perl
by Anonymous Monk on May 06, 2018 at 13:55 UTC | |
by ikegami (Patriarch) on May 06, 2018 at 18:51 UTC | |
by Anonymous Monk on May 07, 2018 at 09:04 UTC |