Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by afoken (Chancellor)
on May 19, 2015 at 18:58 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1127170]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2025-07-09 13:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.