Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I am really glad you included this example, since I was thinking on the previous Tied example that an Attribute autotie would be a useful helper for that one.

    I would find monitoring multiple variables all called $VAR1 frustrating. So I would want to extend the example to use the 2-arg version of Data::Dumper::Dump. Finger-painting, we can replace the Report loop with

    print Data::Dumper::Dump([@monitoring{sort keys %monitoring}],[sort keys %monitoring]);

    To do that, we need to capture the name of the monitored variable, so we replace push @monitoring, $referent; with

    except that doesn't work for the lexicals illustrated, so would have to detect $symbol eq 'LEXICAL' and look for an attribute argument in $data, such as 'Monitor(name=>Fred)'.

    Which makes it so messy I understand why you kept the example simple!


    # I had a sig when sigs were cool
    use Sig;