Thread Data::Dumper require() statt use() (4 answers)
Opened by bianca at 2015-07-27 08:58

bianca
 2015-07-27 08:58
#181663 #181663
User since
2009-09-13
6977 Artikel
BenutzerIn

user image
Guten Morgen!

Wenn ich CPAN:Data::Dumper nicht mit use() sondern require() lade, bekomme ich bei der Nutzung seiner Variablen Hinweise aus CPAN:strict. Wie kann ich die vermeiden?
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl
use strict;
use warnings;

require Data::Dumper; Data::Dumper->import(qw(Dumper));
local $Data::Dumper::Purity = 1;
local $Data::Dumper::Useqq = 1;
local $Data::Dumper::Sortkeys = sub {
    my ($hash) = @_;
    return [(sort {lc $a cmp lc $b} keys %$hash)];
};
my %test = (
    harry   => 'foo',
    larry   => {
        foo2    => 'aar',
        foo     => 'bar',
    },
);
print Dumper(\%test);


P.S.: ist es Absicht, dass man hier in battie in den "Tags" Feldern keine geöffnete runde Klammer verwenden kann?
10 print "Hallo"
20 goto 10

View full thread Data::Dumper require() statt use()