#!/usr/bin/perl -l use strict; use warnings; my $file = "C:\\Games\\kl.txt"; # Das ist die Datei, die ich Textdokument als Hex schreibe sub writeToList{ my $write =shift; open(WRITE, ">> C:\\Users\\Shiu\\hex.txt"); print WRITE $write,"\n"; close(WRITE); } sub verpacken{ my $file = shift; open(IN,"$file") or die "sd"; binmode(IN); while(my $content = do { local $/; }){ my $hex = join ' ', map { unpack 'h*', $_ } do { split //, $content }; writeToList($hex); print $hex; } close(IN); } sub entpacken { my $file =shift; open(OUT, "$file") or die "Beim entpacken"; while(my $write = ){ open(IN, ">> C:\\Users\\Shiu\\lolout"); print IN $write; } close(IN); close(OUT); } &verpacken($file); &entpacken("C:\\Users\\Shiu\\hex.txt");