Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Flag variables

by allolex (Curate)
on Mar 03, 2003 at 22:20 UTC ( #240173=note: print w/replies, xml ) Need Help??


in reply to Flag variables

Maybe wiser heads than mine have posted here, but if you're dying to use flags, you could use constants. So here's an answer to your third question.

use constant PRINTFLAG => 0; use constant SAVEFLAG => 1; use constant MAILFLAG => 2;

And then keep track of it with a status/state variable. That at least makes the code easier to read: $state = PRINTFLAG;, instead of just a number. Of course, it's really only approporiate where multiple states come into question.

--
Allolex

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://240173]
help
Chatterbox?
[Corion]: Whoa! I haven't invoked Crunchy today! But thanks to Crunchy, it's Friday! ;)
[Corion]: A good morning to everybody ;)
[Discipulus]: regular as always.. good morning Corion
[Corion]: Hi Discipulus ;) A good morning to you :)

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2017-01-20 07:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (173 votes). Check out past polls.