Specifying the input encoding
use 5.020; use strict; use warnings; use autodie; use utf8; my $product_file = 'product-list.txt'; open my $fh, '<:utf8', $product_file; # Considered "unsafe" binmode(STDOUT, ':utf8'); while ( <$fh> ) { s/GBP/£/; s/EUR/€/; s/USD/\$/; print; }