jaa has asked for the wisdom of the Perl Monks concerning the following question:
My question is: Will Perl optimise this? specifically, the creation of the two anon hashes? Or am I better to programatically allocate these into hashes with named storage?sub words { return [ map { { # substitute these 'DUTCH' => 'NETHERLANDS', 'GERMANY' => 'DEUTSCHLAND', 'AUST.' => 'AUSTRALIA', }->{$_} or $_ } grep { !{ # skip these 'BANK' => 1, 'CORP' => 1, 'GOVERNMENT' => 1, 'GOVT' => 1, 'LIMITED' => 1, 'LTD' => 1, 'NPV' => 1, 'COM' => 1, }->{$_} } split /\s+/, shift ]; }
Regards & thanks,
Jeff
|
---|