- or download this
my @list = map { chomp($_); $_ } <$fh>;
my @uc_list = map { chomp $_; [uc $_] } <$lc_fh>; # used only onc
+e
my @split_list = map { chomp $_; [ split(/\|/, $_) ] } <$piped_fh>;
+# used only once
- or download this
my @array = map {
$_ =~ s/^[\*\+-] (.+)/$1/;
some_sub($_, $opt);
} @another_array;
- or download this
my @ids = map {
$_ =~ s/<.+?>//g;
...
$_ =~ s/[^\w:.\-]//g;
$_;
} grep {defined($_)} @base;
- or download this
sub fancy_map {
my ($opt, $list) = @_;
...
}
} @{$list};
}
- or download this
if ($raw_value =~ /\*/) { # multiplication
$total_value = eval($raw_value);
...
$base_value = eval($raw_value);
($total_value, $amount) = split(/\//, $raw_value);
}