Thread Byte raw format in String umwandeln (Glib::IO::File->get_contents) (18 answers)
Opened by Max_Perlbeginner at 2016-05-31 10:53

GwenDragon
 2016-05-31 12:04
#184853 #184853
User since
2005-01-17
14759 Artikel
Admin1
[Homepage]
user image
Dumper von CPAN:Data::Dumper kann dir anzeigen, welche Daten vorliegen.
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
use strict;
use warnings;

use 5.010;

use Data::Dumper;

my $buffer_ref = [72,97,108,108,111,32,87,101,108,116]; # Puffer mit Bytes ähnlich deines $content
say Dumper $buffer_ref;

my $string = pack "C*",@{$buffer_ref}; # in eine Zeichenkette umwandeln
say Dumper $string;

Last edited: 2016-05-31 12:07:07 +0200 (CEST)

View full thread Byte raw format in String umwandeln (Glib::IO::File->get_contents)