in reply to What's your programming style?
my %SEPARATOR_BY_OS = ( darwin => ':', MSWin32 => '\\' ); sub get_pathname_separator { $SEPARATOR_BY_OS{$^O} // '/' }
See Platforms in perlport for the possible values of $^O. Note that MACOS isn't part of any value and that your solution would return \ on Mac OS X, as
index 'DARWIN', 'WIN' == 3
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: What's your programming style?
by Laurent_R (Canon) on Dec 08, 2018 at 18:55 UTC | |
by kcott (Archbishop) on Dec 09, 2018 at 02:36 UTC | |
by Laurent_R (Canon) on Dec 09, 2018 at 10:29 UTC | |
by Your Mother (Archbishop) on Dec 09, 2018 at 04:53 UTC | |
by 1nickt (Canon) on Dec 09, 2018 at 01:51 UTC | |
by eyepopslikeamosquito (Archbishop) on Dec 09, 2018 at 02:41 UTC | |
by ikegami (Patriarch) on Dec 09, 2018 at 04:37 UTC | |
by Laurent_R (Canon) on Dec 09, 2018 at 10:20 UTC |