Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Cross-platform accented character file names sorting

by afoken (Canon)
on May 19, 2015 at 18:58 UTC ( #1127170=note: print w/replies, xml ) Need Help??


in reply to Re: Cross-platform accented character file names sorting
in thread Cross-platform accented character file names sorting

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". ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1127170]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2020-08-12 09:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which rocket would you take to Mars?










    Results (65 votes). Check out past polls.

    Notices?