in reply to Design question: storing package 'flags'.

You talk about use but then mention a base class - is your design OO or not? Could you maybe show some short example code to demonstrate the situation you're talking about?

  • Comment on Re: Design question: storing package 'flags'.

Replies are listed 'Best First'.
Re^2: Design question: storing package 'flags'.
by perl-diddler (Chaplain) on Jul 09, 2015 at 08:50 UTC
    That's because in one (or more cases) I do setup-work at BEGIN time, so that any invalid references are caught @compile time. I'm not thinking of 1 particular or specific use case, but several use cases that seem related, but that *could* have different design needs -- so I want to find an orthogonal design that accommodates various usages including ones I may not have thought of yet.

    As a simple example of a simple OO usage w/'use'

    use Data::Vars [qw(one two three answer)], {one=>1, two=>2, three=>3}; my $p=Data::Vars=>new(); $p->answer=$p->one+$p->two*$p->three; P "answer=%s", $p->answer; answer=7
    Will have to think of more situation as I'm getting tired right now...