diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2016-03-03 09:01:05 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2016-03-03 09:01:05 -0500 |
commit | d4c800c79388007845ea9c00700f877d7da0ccb9 (patch) | |
tree | 5b69d5427ce78d8bda8b8928b01a81c099ba8f31 /pod/perlport.pod | |
parent | 61988e87ad52189f879c360ba9c0853205771268 (diff) | |
download | perl-d4c800c79388007845ea9c00700f877d7da0ccb9.tar.gz |
Warn of the "else syndrome".
Not that anyone ever reads perlport.
Diffstat (limited to 'pod/perlport.pod')
-rw-r--r-- | pod/perlport.pod | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pod/perlport.pod b/pod/perlport.pod index 659389d9ec..d77dfa951a 100644 --- a/pod/perlport.pod +++ b/pod/perlport.pod @@ -745,6 +745,17 @@ to other platforms easier. Use the C<Config> module and the special variable C<$^O> to differentiate platforms, as described in L<"PLATFORMS">. +Beware of the "else syndrome": + + if ($^O eq 'MSWin32') { + # code that assumes Windows + } else { + # code that assumes Linux + } + +The C<else> branch should be used for the really ultimate fallback, +not for code specific to some platform. + Be careful in the tests you supply with your module or programs. Module code may be fully portable, but its tests might not be. This often happens when tests spawn off other processes or call external |