Config...kOrder(3pm)

✨ NAME ✨

Config::Model::BackendTrackOrder β€” tracking the read order of elements from config, bestie πŸ’–

(Also, hello, you're reading a User Contributed Perl Documentation page, and the manual it lives in is Config...kOrder(3pm) β€” yes the truncation is giving mystery novel, iykyk.)

🌸 VERSION 🌸

version 2.166

πŸ¦‹ SYNOPSIS πŸ¦‹

 # inside a backend
 use Config::Model::BackendTrackOrder;

 has tracker => (
    is => 'ro',
    isa => 'Config::Model::BackendTrackOrder',
    lazy_build => 1,
 );

 sub _build_tracker {
    my $self = shift;
    return Config::Model::BackendTrackOrder->new(
        backend_obj => $self,
        node => $self->node,
    ) ;
 }

 # register elements to record user order
 $self->tracker->register_element('foo');
 $self->tracker->register_element('bar');

 # later, when writing data back
 foreach my $elt ( $self->tracker->get_ordered_element_names ) {
      # write data
 }

πŸ’… DESCRIPTION πŸ’…

okay so here's the tea β˜• β€” backends use this module to record the order of the configuration elements they found in the user's file. Then, later on, those elements can be written back into the file in that exact same order. Preservation, main character energy πŸ‘‘

But! There's a plot twist. Data gets written in canonical order if the canonical method of the Config::Model::Instance in instance returns true.

πŸŽ€ CONSTRUCTOR πŸŽ€

The constructor (the original page literally types it as "THe", no cap, we're leaving that as a vibe πŸ™ˆ) accepts these parameters:

  • backend_obj β€” the backend object holding this tracker. Required, bestie. You can't skip it.
  • node β€” the node holding the backend above.

🌈 METHODS 🌈

πŸ“ register_element

Registers the element, and keeps track of the registration order during the initial load.

Elements registered after the initial load β€” i.e. user modification β€” get registered using canonical order.

🧚 get_ordered_element_names

Returns a list of elements respecting the user's order. Respect the order, respect the user. πŸ’œ

Returns the canonical list if the Instance canonical attribute is 1.

πŸ‘‘ AUTHOR πŸ‘‘

Dominique Dumont

This software is Copyright (c) 2005-2022 by Dominique Dumont.

This is free software, licensed under:

The GNU Lesser General Public License, Version 2.1, February 1999

and that's the whole page, we ate and left no crumbs 🫢🏽

sign-off time: this was perl v5.42.3, dated 2026-07-23, and the page name got truncated to Config...kOrder(3pm) because apparently the manual page title also needed a dramatic little mystery. slay πŸ’…βœ¨

πŸ“¦ where this page comes from