in reply to pushing to array
use strict; use warnings; use Data::Dumper; <DATA>; my @products = keys %{{ map { /^\d+\s+(\w+)$/ ? ($1,1) : () } <DATA> } +}; print Dumper(\@products); __DATA__ price product 200 shoe 20 shirt 10 shirt 5 hat
$VAR1 = [ 'hat', 'shirt', 'shoe' ];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: pushing to array
by aquarium (Curate) on Mar 02, 2004 at 12:25 UTC |