Thread Hash in Sub dereferenzieren (18 answers)
Opened by Opaxtl at 2007-04-19 16:24

Ronnie
 2007-04-19 16:38
#76040 #76040
User since
2003-08-14
2022 Artikel
BenutzerIn
[default_avatar]
Wenn du use warnings; verwendest, sagt dir perl wieso!
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl

use strict;
use warnings;

use Data::Dumper;

my %hash = ( foo => 42, bar => '0815', buz => 'Woodstock' );

sub foo {
my %hash = %{shift @_}; # use warnings!
warn Dumper \%hash;
}

foo(\%hash);
\n\n

<!--EDIT|Ronnie|1176986545-->

View full thread Hash in Sub dereferenzieren