Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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 making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-26 08:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found