in reply to Monitoring a variable during refactoring

Not too long ago, ikegami has recommended the use of Variable::Magic for a very similar problem. I guess it is difficult to find that gem by googling.
  • Comment on Re: Monitoring a variable during refactoring

Replies are listed 'Best First'.
Re^2: Monitoring a variable during refactoring
by LanX (Saint) on Jul 03, 2019 at 19:22 UTC
    Thanks good to know.

    It might be overkill in my case but handy in others. :)

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

      I just wondered what Uncle Bob might say about all this magic stuff.

      «The Crux of the Biscuit is the Apostrophe»

      perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

        Perhaps the word "magic" pre-disposes a programmer against it. Especially us non-tolkien fans. But thinking about it more I say it aids transparency as far as I can know who reads or modifies my variablles. However, if by "magic", variables are unxplainedly altered then that's ACME territory.

        Is this "magic" not the same as having a private variable within a class only accessible via magic hooks aka getter and setter methods which may spawn many actions in addition to getting and setting a variable?

        I have no idea and never heard of Bob before.

        But I wonder what you think. Care to elaborate?

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery FootballPerl is like chess, only without the dice