harangzsolt33 has asked for the wisdom of the Perl Monks concerning the following question:
Edit: Here is an example what I am trying to achieve: For example, my $CD; I want this to be tied to the current directory, so when I do print $CD; then when it tries to read the scalar value, it first calls _MyGetCWD() function and then prints the value returned by this function. And likewise, if I try to set this variable $CD = "C:\\WINDOWS"; then when it sees that I am trying to modify this scalar, then it immediately calls _MySetCWD($NewValue) function to do the job. How do I do this?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to Intercept Variable Access
by ikegami (Patriarch) on Sep 16, 2024 at 10:38 UTC | |
by bliako (Abbot) on Sep 16, 2024 at 11:16 UTC | |
|
Re: How to Intercept Variable Access
by LanX (Saint) on Sep 16, 2024 at 01:32 UTC | |
by harangzsolt33 (Deacon) on Sep 16, 2024 at 02:00 UTC | |
by LanX (Saint) on Sep 16, 2024 at 12:37 UTC | |
by Corion (Patriarch) on Sep 16, 2024 at 12:43 UTC | |
by LanX (Saint) on Sep 16, 2024 at 14:31 UTC |