@_ =~ s/.../.../g;
should be
$_ =~ s/.../.../g;
or just
s/.../.../g;
$_ is aliased to the current member of @_ by the foreach loop.
==string
should be
eqstring
See perlop for the difference.
checkCurrency($hardwareValue1, $hardwareValue2); sub checkCurrency{ for (@_) { if ($currency eq "Euro (EUR)") { s/€//g; }elsif ($currency eq "Japan, Yen(JPY)") { s/Â/ /g; }elsif ($currency eq "United Kingdom, Pound(GBP)") { s/Â/ /g; } } }
Of course, the real problem is that you're not using Encode's decode to translate UTF-8 bytes into characters, and later Encode's encode to translate the characters into the proper encoding (or Encode's from_to to do it in one step).
In reply to Re: Passing Array to Function for search and Replace
by ikegami
in thread Passing Array to Function for search and Replace
by ikkon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |