in reply to Multidimensional arrays

Needing an extra dimension makes me wonder if these new details should also live in the database? One benefit would be to remove much of the duplicated info introduced above (via normalization).

Replies are listed 'Best First'.
Re^2: Multidimensional arrays
by Bod (Parson) on Jun 07, 2023 at 20:44 UTC
    makes me wonder if these new details should also live in the database

    Yes - they probably should!

    Most of my sites have multiple environments with identical copies of the codebase except for a Variables.pm file that defines things like the DB instance to connect to, Stripe and other keys. Naturally, the Stripe price keys got put in there which is sensible when there are just 3 keys.

    I was planning to extend what I already had. Then I realised that I probably needed a method in the common module for the site to return the correct Stripe price keys. Your observation that these are better stored in the DB really does make sense especially as a method is needed to read them anyway. It may as well just read the database!

    Thanks you pointing out that to which I has cognitive blindness :)