Perl Monk, Perl Meditation | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Sure, here's my example: I process incoming form inputs, default variables, and a user's preferences stored in a database--all three--to determine the value of a variable. That variable is given its proper order of precedence. When the form is first loaded, the user has not even logged in, so the default value should be assigned. After login, the preference stored in the database should be assigned. But if, via the form, the user has selected a different value, now the form's own inputs value should be assigned. Something like this:
Please ignore the "roughness" of the example--it's not my actual code and only meant to be illustrative of the variable assignment situation. Obviously, the user's form inputs will not be initialized in the hash before the user has even logged in. Blessings, ~Polyglot~ In reply to Re^3: Is this code correct
by Polyglot
|
|