in reply to What's your programming style?

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,

Replies are listed 'Best First'.
Re^2: What's your programming style?
by Anonymous Monk on Dec 08, 2018 at 05:07 UTC
    Wow, you are a perl wizard! :-0
      That's not from an "Anonymous monk." I don't know how I got logged out. :P