in reply to Re: lvalue and perl debug
in thread lvalue and perl debug

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.

Replies are listed 'Best First'.
Re^3: lvalue and perl debug
by aquarium (Curate) on Dec 09, 2007 at 23:28 UTC
    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. } ... }