![]() |
|
Welcome to the Monastery | |
PerlMonks |
Re^2: Cross-platform accented character file names sortingby afoken (Chancellor) |
on May 19, 2015 at 18:58 UTC ( #1127170=note: print w/replies, xml ) | Need Help?? |
Note also that the Config module isn’t needed for this test. Either $ENV{OS} or $^O will give you the information you need. $ENV{OS} is specific for Windows (I think NT and following, never saw it on 3.x or 9x), it is not set on Linux. A malicious user could set it to any nonsense value. Try to avoid that. $^O is reliable, returning MSWin32 for each and every Windows version (except perhaps Windows CE / Mobile), including 64 bit variants. After checking $^O eq 'MSWin32', the type (NT-based or DOS-based) and the exact version can be checked using Win32::IsWinNT(), Win32::IsWin95(), Win32::GetOSVersion(), Win32::GetOSName(), and Win32::GetOSDisplayName(). All of these functions are documented in Win32, those marked with [CORE] are built into the perl executable and are available without loading the Win32 module. Alexander
-- Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
In Section
Seekers of Perl Wisdom
|
|