Scroll to navigation

Config::Find::WinAny(3pm) User Contributed Perl Documentation Config::Find::WinAny(3pm)


Config::Find::WinAny - Behaviours common to any Win32 OS for Config::Find


  # don't use Config::Find::WinAny directly
  use Config::Find;


Implements features common to all the Win32 OS's


This module implements Config::Find for Win32 OS's.

WARNING!!! Configuration file placement has changed on version 0.15 to be more Windows friendly (see note below).

Order for config files searching is... (see note at the end for entries marked as 1b and 2b)

  1  ${LOCAL_APPDATA}/$name.cfg                [user]
 (1b /$path_to_script/Users/$user/$name.cfg    [user])
  2  /$path_to_script/$name.cfg                [global]

unless when $ENV{${name}_HOME} is defined. That changes the search paths to...

 (1b $ENV{${name}_HOME}/Users/$user/$name.cfg  [user])
  2  $ENV{${name}_HOME}/$name.cfg              [global]

When the "several configuration files in one directory" approach is used, the order is something different...

  1  ${LOCAL_APPDATA}/$dir/$name.cfg              [user]
 (1b /$path_to_script/Users/$user/$dir/$name.cfg  [user])
  2  /$path_to_script/$name.cfg                   [global]
 (2b /$path_to_script/$dir/$name.dfg              [global])

(it is also affected by $ENV{${name}_HOME} variable)

Note: entries marked as 1b were the default behaviour for versions of Config::Find until 0.14. New behaviour is to put user application configuration data under ${LOCAL_APPDATA} as returned by "Win32::GetFolderPath(CSIDL_LOCAL_APPDATA)" (if this call fails, the old approach is used). Also, global configuration files were stored under a new directory placed in the same directory as the script but this is unnecessary because windows apps already go in their own directory.

It seems that, sometimes, ${LOCAL_APPDATA} points to the user desktop and placing configuration files there would be obviously wrong. As a work around, the module will ignore ${LOCAL_APPDATA} or ${APPDATA} if they point to any place below the desktop path.


Config::Find, Config::Find::Any


Salvador Fandiño García, <>


Barbie, <> (some bug fixes and documentation)


Copyright 2003-2015 by Salvador Fandiño García ( Copyright 2015 by Barbie (

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

2022-12-07 perl v5.36.0