Just to make this extra fun.... You CAN change variables after they've been assigned.
If you assign a new value to the variable in a template, it will pick up the new value. Note that this should NOT be used as a feature but I'm sure it'll bite someone like it did me at some point since it lovely and random but, once set, is set for that variable as long as it's memory resident. Note: I haven't checked that this still happens in a while but I would bet that it does. Trevor On Fri, Aug 24, 2012 at 7:02 PM, Nick Fagerlund <nick.fagerl...@puppetlabs.com> wrote: >> - Arrays and Hashes are mutable; which is either an bug or a language >> feature. While it is not allowed to directly change a variable, it can >> be indirectly modified if it refers to an array or hash. Great if the >> documentation can clarify if this is a supported feature or should be >> avoided. i.e. $a = [1,2,3] $a[0] = 10. (IMO, this is problematic as any >> logic can refer to the variable and assign to an entry - at least last I >> tried). > > > D:< EWW. "Problematic" is putting it mildly, especially since behavior is > inconsistent between arrays and hashes. (Both can add, only arrays can > reassign to existing indexes.) But I'd better document it anyhow. > -- Trevor Vaughan Vice President, Onyx Point, Inc (410) 541-6699 tvaug...@onyxpoint.com -- This account not approved for unencrypted proprietary information -- -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.