Thread Wie kann man Variablen als GLOB verwenden? (7 answers)
Opened by bianca at 2016-04-15 18:53

bianca
 2016-04-17 08:30
#184463 #184463
User since
2009-09-13
7016 Artikel
BenutzerIn

user image
Man muss es auch richtig schreiben...(meine Doofheit)
Danke, pq!

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/perl
use strict;
use warnings;
use Fcntl qw(:DEFAULT);
use Data::Dumper;
require Data::Dumper;
local $Data::Dumper::Purity;
$Data::Dumper::Purity = 1;
local $Data::Dumper::Useqq;
$Data::Dumper::Useqq = 1;
local $Data::Dumper::Sortkeys;
$Data::Dumper::Sortkeys = sub {
    my ($hash) = @_;
    return [(sort {lc $a cmp lc $b} keys %$hash)];
};
use 5.010;

require IO::String;
require MIME::Explode;
my $fhin = IO::String->new("Date: Sat, 16 Apr 2016 17:24:09 +0200\nSubject: Testsubject\n\nTesttext");
my $fhout = IO::String->new();
my $explode = MIME::Explode->new(
    decode_subject      => 1,
    check_content_type  => 1,
    types_action        => 'include',
);
if (my $headers = $explode->parse(*$fhin,*$fhout)) {
    say Dumper($headers);
    say '#########################################';
    say "Out: '${$fhout->string_ref}'";
}

Last edited: 2016-04-17 08:32:22 +0200 (CEST)
10 print "Hallo"
20 goto 10

View full thread Wie kann man Variablen als GLOB verwenden?