#!/usr/bin/perl use strict; use warnings; use Encode qw(encode decode); my $text="The quick red fox jumped over the lazy brown dog. 0123456789"; my $txt_ASCII = encode("iso-8859-1", $text); my $txt_EBCDIC = encode("cp37", $text); print "ORIGINAL: $text\n"; print "EBCDIC : $txt_EBCDIC\n"; print "ASCII : $txt_ASCII\n";