in reply to lvalue and perl debug

Considering the limited usefulness of lvalue subs in Perl (i.e. you can't validate or otherwise manipulate the value assigned to a function), they just add visual confusion. I don't see any value in them as they currently exist.

Replies are listed 'Best First'.
Re^2: lvalue and perl debug
by deepfryed (Novice) on Dec 09, 2007 at 22:24 UTC
    I thought I replied to this one earlier, but it did not show up. Validation can be done using tied hashes or a sep. validate method. My only gripe at this point is not being to use lvalue subs in debug.
      don't you have to "use subs" or other some such pragma?
      the hardest line to type correctly is: stty erase ^H
        Nope, not really.
        my %foo; tie %foo, 'My::SpecialValidator'; sub bar : lvalue { $foo{bar}; } package My::SpecialValidator; sub STORE { my ($class, $attr, $value); if ($attr eq 'bar' && $value !~ /^\d$/) { # exception. } ... }