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' ];
In reply to Re: pushing to array
by Roger
in thread pushing to array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |