#!/usr/bin/perl open(fil,"file.txt"); @file = ; close(fil); $converted=""; foreach(@file) { (@chrs) = split("",$_); foreach $chr(@chrs) { my $asciiChar = ord($chr); ###########DO Hex Stuff HERE########## $hexChr $converted = join("",$converted,$hexChr); } } open(outp, ">output.txt"); print outp $converted; close(outp);