in reply to Can this code be optimized further?
#!/usr/bin/perl use warnings; use strict; my @temp = qw( a_1 b_1 a_2 a_3 a_4 b_2 a_5 b_3 a_6 b_4 ); my %parts; push @{ $parts{ substr $_, 0, 1 }}, substr $_, 2 foreach @temp; use Data::Dumper; print Dumper \%parts;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Can this code be optimized further?
by Anonymous Monk on Feb 10, 2005 at 17:56 UTC | |
by phaylon (Curate) on Feb 10, 2005 at 18:34 UTC |