sub getFileContent{ my ($input,$enc) = @_; my $defaultEncoding = "utf8"; my $encoding = ($enc) ? "encoding($enc)" : "encoding($defaultEncoding)"; my @content; open(DAT, $input) || die("Could not open file $input $!"); binmode(DAT, "$encoding"); @content=; close(DAT); return @content; }