Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Foreach in a 2D array

by ihb (Deacon)
on Oct 29, 2004 at 15:57 UTC ( [id://403797]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @data = (
        [ Gender => [ 'Male', 'Female'] ],
        [ A => [ 'a', 'b', 'c'] ],
    );
    
  2. or download this
    for (@data) {
        my ($column, $options) = @$_;
    ...
            print '<input type="radio" name="' . $column . '" value="' . $
    +option . '"> ' . $option . ' ';
        }
    }
    
  3. or download this
            printf qq{<input type="radio" name="%s" value="%s">%s\n},
                $column,
                $option,
                $option
            ;
    
  4. or download this
    use strict;
    use CGI;
    ...
        # no value checked by default, as long as you
        # don't have '_' as an option.
    }
    
  5. or download this
    my %dataoptions = map @$_, @data;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-06-25 06:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.