Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Design question: storing package 'flags'.

by Anonymous Monk
on Jul 09, 2015 at 08:06 UTC ( [id://1133905]=note: print w/replies, xml ) Need Help??


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...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1133905]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-24 10:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found