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":
    }