Help for this page

Select Code to Download


  1. or download this
    ../cgi-bin/script.pl?column3=1&column2=2&column1=3
    
  2. or download this
    my $q = new CGI;
    my $href = $q->Vars;
    
  3. or download this
    my $col_string = join( ',', sort {$$href{$a} <=> $$href{$b}} keys %$hr
    +ef );
    
  4. or download this
    $col_string =~ s/^,+//;      # remove leading commas
    $col_string =~ s/,+$//;      # remove trailing commas
    $col_string =~ s/,{2,}/,/g;  # reduce adjacent commas to ","
    
  5. or download this
    my $col_string = '';
    for my $var ( sort {$$href{$a} <=> $$href{$b}} keys %$href ) {
        $col_string .= "$var,";
    }
    chop $col_string;  # remove final comma
    
  6. or download this
    my $sql = "SELECT $col_string FROM my_table";