Thread Startscript: Kleines Problem mit meinen Ideen ein Tea (34 answers)
Opened by Gast at 2005-05-15 07:04

Strat
 2005-05-17 19:38
#54959 #54959
User since
2003-08-04
5246 Artikel
ModeratorIn
[Homepage] [default_avatar]
also bei vielen if's/elsif's mit kurzem blockinhalt empfehle ich
Code: (dl )
1
2
3
4
5
if    ($action eq 'x1') { print "Action $action\n" }
elsif ($action eq 'x2') { print "Action $action\n" }
elsif ($action eq 'x3') { print "Action $action\n" }
elsif ($action eq 'x4') { print "Action $action\n" }
elsif ($action eq 'x5') { print "Action $action\n" }

(ok, kein besonders sinnvolles beispiel, und koennte man auch mit einem switch-ersatz vielleicht noch besser lesbar loesen, aber sowas finde ich besser lesbar als
Code: (dl )
1
2
3
4
if ($action eq 'x1') {
 print "Action: $action\n";
}
elsif ...
perl -le "s::*erlco'unaty.'.dk':e,y;*kn:ai;penmic;;print"
http://www.fabiani.net/

View full thread Startscript: Kleines Problem mit meinen Ideen ein Tea