Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: My excessive and redundant code<333

by Tanktalus (Canon)
on Jun 23, 2005 at 04:07 UTC ( [id://469284]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @comment_cols = qw/title author thread_id id/;
    for (@comments) {
    ...
        @data{@comment_cols} = $_->get(@comment_cols);
        push @c_data, \%data;
    }
    
  2. or download this
    my %comment_cols = qw/
      c_title title
    ...
        @data{keys %comment_cols} = $_->get(values %comment_cols);
        push @c_data, \%data;
    }
    
  3. or download this
    @c_data = map {
        my %data;
        @data{keys %comment_cols} = $_->get(values %comment_cols);
        \%data;
    } @comments;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-03-28 21:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found