Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Constant Variables

by dga (Hermit)
on Mar 28, 2003 at 16:44 UTC ( [id://246509]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    create table prefs ( user_login text, color1 text, color2 text, fontsi
    +ze text, ... , primary key (user_login) );
    
  2. or download this
    use constant DS => 'my dsn here';
    
    ...
    {
      print STDERR "Informative error message goes here with $@ for good m
    +easure\n";
    }
    
  3. or download this
    #change lines from above
    my($color1 ...); #becomes
    ...
      $prefs={ color1 => $c1, color2 => $c2, fontsize => $fs };
    #later to get a pref
    print "My favorite color is $prefs->{color1}\n";
    
  4. or download this
    create table prefs ( user_login text, prefname text, prefvalue text, p
    +rimary key ( user_login, prefname) );
    
  5. or download this
    my %prefs;
    ...
    ...
    {
      print "I like my $p to be $prefs{$p}\n":
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (1)
As of 2024-04-19 18:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found