Thread Block vs. Hashref (25 answers)
Opened by barney at 2024-08-02 13:17

rosti
 2024-08-07 11:37
#196643 #196643
User since
2011-03-19
3492 Artikel
BenutzerIn
[Homepage]
user image
Nunja, wenn man einen hash haben will sollte man schon beachten, daß der Schlüssel in einem hash nur einmal vorkommt ;)

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
use strict;
use warnings;
use Data::Dumper;
use FindBin qw($Bin);

my @dirs = grep -d, ('foo','bar','.',$Bin,'c:/temp'); # valide directories
my $hr = { map{ ("here", "$_") } @dirs };
my $ar = [ map{ ("here", "$_") } @dirs ];
print Dumper $hr, $ar;

Last edited: 2024-08-07 11:39:08 +0200 (CEST)

View full thread Block vs. Hashref