3 ms·
die "Port numbers below 1024 are forbidden" if $port < 1024; is hardly unreadable spaghetti code.
by TomSwirly 4y ago
die "Port numbers below 1024 are forbidden"
if $port < 1024;
is hardly unreadable spaghetti code.
- gpvos 4y agoOkay. Now compare: die "You may only use port numbers 1024 and higher" unless $port >= 1024 || is_root(current_uid()); die "Port numbers 1024 are forbidden" if $port < 1024 && !is_root(current_uid());
- hashhar 4y agoMy head hurts! Does unless apply to both branches or just one. The if example is easier for sure.