Help for this page

Select Code to Download


  1. or download this
    #col1name and col2name are the names of the columns in the database
    $hash_ref = { col1name=>"orange",
                  col2name=>"15" };
    
  2. or download this
    # get whole result set into an array
    
    ...
    #let's map the first elements to the keys of the hash
    # and the second elements to the values.
    my %hash = map { $_->[0] => $_->[1] } @rs;
    
  3. or download this
    perl -e 'print "How sweet does a rose smell? "; chomp ($n = <STDIN>); 
    +$rose = "smells sweet to degree $n"; *other_name = *rose; print "$oth
    +er_name\n"'