Hello harangzsolt33,
Since the value of $^O can’t change at runtime, SEPARATOR should be evaluated at compile time. Also, why use index and uc and a comparison, when a simple regex will do?
use strict; use warnings; use constant SEPARATOR => $^O =~ /MACOS/i ? ':' : $^O =~ /WIN/i ? '\\' : '/'; print 'SEPARATOR is "' . SEPARATOR . "\"\n";
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: What's your programming style?
by Athanasius
in thread What's your programming style?
by harangzsolt33
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |