I have a simple question for the group.  Consider the following string.

$_ = 'use_name,mat_id,use_id,use_fname,mat_name,use_lname';


How could I elegantly split/loop this into the following structure?
%hash = (
        use => ["use_name","use_id","use_fname","use_lname"],
        mat => ["mat_id","mat_name"]    
};

I started something like

foreach (split(/,/)) {
        /(\w+)_\w+/;
        $group{$1}++;
}

But I need to push the values into an array with out doing tons of loops?

Thanks,
Jay
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to