Config...WinAny(3pm)

πŸ“¦
version 0.31 Β· 2 versions
  • 0.31 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.31 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Config::Find::WinAny β€” the behaviours that every single Win32 OS has in common, for Config::Find. It's the shared vibe, the group chat everyone's in 🫢


✨ SYNOPSIS ✨

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

Okay bestie, read that comment again. You do not use this one directly, you let Config::Find pull it in. It's giving backstage pass, not front door πŸ”‘


πŸŽ€ ABSTRACT πŸŽ€

It implements the features that are common to all the Win32 OS's. Like, every Windows, no exceptions, that's the whole point πŸ’…


🌸 DESCRIPTION 🌸

This module implements Config::Find for Win32 OS's. That's the mission, that's the lore ✨

WARNING!!! Configuration file placement has changed on version 0.15 to be more Windows friendly (see the note below, don't skip it πŸ™ˆ).

So here's the order for config files searching… (and yes, the entries marked as 1b and 2b get their own note at the end, hold on)

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

UNLESS β€” and this is the plot twist β€” when $ENV{${name}_HOME} is defined. Then the whole search path situation changes to…

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

And when you're doing the "several configuration files in one directory" approach? The order is something different 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 the $ENV{${name}_HOME} variable, so yeah, that one keeps showing up like the main character it is πŸ‘‘)


πŸ¦‹ the note (do not skip) πŸ¦‹

Entries marked as 1b were the default behaviour for versions of Config::Find until 0.14. The new behaviour is to put user application configuration data under ${LOCAL_APPDATA} as returned by Win32::GetFolderPath(CSIDL_LOCAL_APPDATA) β€” and if that call fails, bestie, we just use the old approach instead, no drama πŸ’œ

Also, global configuration files used to be stored under a new directory placed in the same directory as the script, but honestly that's unnecessary because windows apps already go in their own directory. Periodt. πŸ’…


πŸ™ˆ the desktop situation πŸ™ˆ

It seems that, sometimes, ${LOCAL_APPDATA} points to the user desktop β€” and placing configuration files there would be obviously wrong, like, imagine 😭 As a work around, the module will ignore ${LOCAL_APPDATA} or ${APPDATA} if they point to any place below the desktop path. Vibe check: failed, so we ignore them 🚫


🌈 SEE ALSO 🌈

  • Config::Find
  • Config::Find::Any

πŸ’œ AUTHOR πŸ’œ

Salvador FandiΓ±o GarcΓ­a, <sfandino@yahoo.com>


🫢 CONTRIBUTORS 🫢

Barbie, <barbie@missbarbell.co.uk> (some bug fixes and documentation) β€” ate that, no crumbs πŸŽ€


Copyright 2003-2015 by Salvador FandiΓ±o GarcΓ­a (sfandino@yahoo.com) Copyright 2015 by Barbie (barbie@missbarbell.co.uk)

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


And that's the whole page, bestie 🧚 this was Config...WinAny(3pm) from the User Contributed Perl Documentation, sitting at perl v5.36.0, dated 2022-12-07. Stan a classic, love you, bye πŸ’–βœ¨

πŸ“¦ where this page comes from